Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Rewrite documentation around reader tasks

d1f44d838966c0a4762073f12375ec7562582fdf · Keenan Nemetz · 21h ago · parent 9103f6a8

docs/change-requests.md +304−77

@@ -1,144 +1,199 @@
1 ---
2 mermaid: true
3 ---
4
1 5 # Change requests
2 6
3 Use a change request to review a branch before it lands. Vole stores the
4 request's base and head, discussion, approvals, and linked issues on the
7 Use a change request to review a branch before it lands. Vole records the exact
8 base and head under review, the discussion, and each approval on the
5 9 repository's `vole` branch. CI results remain on the instance and appear beside
6 10 the review.
7 11
8 ## Open a request
12 <figure class="doc-figure">
13 <div class="mermaid" data-source="flowchart TB; push[&quot;Push a branch&quot;] --&gt; open[&quot;Open a change request&quot;]; open --&gt; review[&quot;Review&lt;br/&gt;approve the displayed head&quot;]; review --&gt; checks[&quot;Checks pass&lt;br/&gt;required runner results&quot;]; checks --&gt; merge[&quot;Merge&lt;br/&gt;land and close issues&quot;]"></div>
14 <figcaption>An approval names an exact base and head. Push a new commit and that head needs fresh approval and checks.</figcaption>
15 </figure>
16
17 Start from a clone whose Vole remote is `origin`. The examples use a `fix-search`
18 branch, issue `#1`, and change request `#2`. Issues and requests share one number
19 sequence, so your request may have a different number.
20
21 ## 1. Push a branch
9 22
10 Start with a branch on the Vole remote. A maintainer can push an ordinary branch:
23 Create a branch, commit your changes, and push it. Replace `<file>` with the
24 paths you changed:
11 25
12 26 ```sh
13 27 git switch -c fix-search
28 git add <file>
29 git commit -m "Handle an empty search index"
14 30 git push -u origin fix-search
15 31 ```
16 32
17 A contributor must use their account namespace instead:
33 A maintainer can push an ordinary branch. A contributor must push into their
34 account namespace instead:
18 35
19 36 ```sh
20 37 git push -u origin HEAD:refs/heads/contrib/<account>/fix-search
21 38 ```
22 39
23 Open the request from a clone:
40 Use that full contributor branch name for `--head` below.
41
42 !!! note "Contributor branches and CI"
43 CI waits for a maintainer to choose **Allow CI** for the exact contributor
44 commit. Every new head needs another decision. See
45 [Contributor branches](workflows.md#contributor-branches).
46
47 ## 2. Open the request
48
49 Open a request from `fix-search` into `main`:
24 50
25 51 ```sh
26 52 vole change new \
27 53 --title "Handle an empty search index" \
28 54 --base main \
29 55 --head fix-search \
30 --closes 42 \
56 --closes 1 \
31 57 -m "Explain the cause, the fix, and how you tested it."
32 58 ```
33 59
34 Use `--closes` only when an issue exists. Repeat it to link multiple issues, or
35 omit it when the repository does not require a link. The browser's **Open change
36 request** form lists branches your account may propose and provides the same
37 fields.
60 Omit `--closes 1` when there is no issue to close. Repeat it to link multiple
61 issues. The command prints the request's durable ULID and ends with:
62
63 ```text
64 opened as #2
65 ```
66
67 The browser's **Open change request** form offers the same fields and lists
68 branches your account may propose.
38 69
39 The request follows its remote head branch. If your clone is behind, Vole records
40 the remote tip rather than your stale local commit. A request must contain a
70 The request follows the remote head branch. If your local branch is behind, Vole
71 records the remote tip rather than your stale commit. The head must contain a
41 72 change: Vole refuses a head that is already the base or one of its ancestors.
42 73
43 ## Review and discuss
74 ## 3. Review and discuss
44 75
45 Inspect the request and its checks:
76 List open requests and inspect one:
46 77
47 78 ```sh
48 vole change show 43
79 vole change list
80 vole change show 2
49 81 ```
50 82
51 The output identifies the exact base and head, required approvals, CI runs, and
52 combined-result state when a merge is needed. In the browser, **Conversation**
53 contains the discussion and approvals, **Commits** lists the branch's commits
54 oldest first with a page for each, **Files** contains the diff and line comments,
55 and **Runs** contains workflow results.
83 `change show` prints the exact base and head, followed branch, approval state,
84 mergeability, and combined-result state when a merge is needed. It also prints
85 comment IDs for replies and edits.
56 86
57 Add general or line-specific feedback:
87 In the browser, use **Conversation** for discussion and approvals, **Commits**
88 for the branch history, **Files** for the diff and line comments, and **Runs**
89 for workflow results.
90
91 Add general feedback or comment on a diff line:
58 92
59 93 ```sh
60 vole change comment 43 -m "Does this handle an empty repository?"
61 vole change comment 43 --path internal/search.go --line 88 \
94 vole change comment 2 -m "Does this handle an empty repository?"
95 vole change comment 2 --path <file> --line <line> \
62 96 -m "This drops the empty-index check."
63 vole change comment 43 --reply-to <comment-id> -m "Added a regression test."
64 97 ```
65 98
66 Use `--side old` to comment on a removed line. A line comment retains the blob it
67 was written against, so the review can show its original context after the branch
68 moves. The browser marks outdated line comments when the file changes.
99 Replace `<file>` and `<line>` with a path and line number from the diff. Use
100 `--side old` for a removed line. If the CLI reports that the relevant commits
101 are missing, run `git fetch origin` and try again.
102
103 Reply to a comment, or edit and delete your own:
104
105 ```sh
106 vole change comment 2 --reply-to <comment-id> -m "Added a regression test."
107 vole change edit-comment 2 <comment-id> -m "Corrected review note."
108 vole change rm-comment 2 <comment-id>
109 ```
110
111 A line comment retains the source blob it reviewed, so Vole can show its original
112 context and mark it outdated when that file changes. Deleted comments leave
113 tombstones; their old text remains in Git history.
69 114
70 ## Address review
115 ## 4. Address review
71 116
72 Commit on the same branch and push it:
117 Commit on the same branch and push again:
73 118
74 119 ```sh
75 120 git push origin fix-search
76 121 ```
77 122
78 The request automatically follows the new remote tip. Do not run
79 `vole change update --head` after an ordinary push. A new head invalidates
80 approvals of the old head and needs new CI results. Contributor-branch CI also
81 waits for a maintainer to allow the new tip.
123 The request follows the new remote tip automatically. Do not run
124 `vole change update --head` after an ordinary push. A new head makes approvals
125 of the old head stop counting and needs new CI results. Contributor-branch CI
126 also waits for approval of the new tip.
82 127
83 128 Use `change update --head <branch>` only to follow a different branch, or
84 `--head <commit>` to pin a request to one commit. Use `--base <branch>` when
85 retargeting the review; changing the base also requires fresh approval.
129 `--head <commit>` to pin the request to one commit. Use `--base <branch>` to
130 retarget the review; changing the base also invalidates earlier approvals.
86 131
87 ## Approve and merge
132 ## 5. Approve and merge
88 133
89 A reviewer with maintain access approves the exact displayed head:
134 A reviewer other than the author, with maintainer or admin access, approves the
135 exact displayed head:
90 136
91 137 ```sh
92 vole change approve 43
138 vole change approve 2
93 139 ```
94 140
95 Do not approve your own request. After the required approvals and checks pass, a
96 maintainer can land it:
141 Vole refuses self-approval. After the required approvals and trusted CI checks
142 pass, a maintainer can merge the request:
97 143
98 144 ```sh
99 145 vole change merge <request-ulid>
100 146 ```
101 147
102 148 Use the full ULID printed by `change new` or `change show` for this server-side
103 operation. The browser's **Merge** action performs the same checks. If `main`
104 moved after the review, Vole tests the combined base and head before landing it.
105 **Merge when
106 ready** lands that combined result after it passes. A new head, a closed request,
107 lost merge permission, or a conflict cancels that wait.
149 operation. The browser's **Merge** action applies the same rules.
150
151 If the base moved and the branches cannot fast-forward, Vole tests the combined
152 result before landing it. When that result is still running, the merge command
153 or **Merge when ready** waits to land a passing result. A new head, a closed
154 request, lost merge permission, or a conflict cancels the wait.
155
156 After merging, update your local base branch and inspect the result:
108 157
109 See [Approvals and combined results](reference/change-requests.md#approvals-and-combined-results)
110 for the exact invalidation and merge rules.
158 ```sh
159 git switch main
160 git pull
161 vole change show 2
162 vole issue show 1
163 ```
164
165 The request is now `merged`. A linked issue is `closed`; omit the issue command
166 if the request did not link one.
111 167
112 168 ## Correct the title or description
113 169
114 The title and description are prose, not what a review names: an approval names
115 its base and head. Fix either one without starting the review over, including on
116 a request that has already closed or merged:
170 Correct prose without starting the review over, including on a closed or merged
171 request:
117 172
118 173 ```sh
119 vole change update 43 --title "Handle an empty search index"
120 vole change update 43 -m "Corrected explanation, same reviewed commit."
121 vole change update 43 -F notes.md
174 vole change update 2 --title "Handle an empty search index safely"
175 vole change update 2 -m "Corrected explanation; the reviewed head is unchanged."
122 176 ```
123 177
124 `--title` replaces the title; `-m` or `-F` replaces the description. Both leave
125 the base, the head, and any approval untouched.
178 `--title` replaces the title; `-m` or `-F` replaces the description. These edits
179 leave the base, head, and approvals untouched because approvals name commits,
180 not prose.
126 181
127 182 ## Link issues to a change
128 183
129 A change's `closes:` metadata, not prose such as `Fixes #42`, closes issues when
130 the change lands:
184 The request's `closes:` metadata, not prose such as `Fixes #1`, closes issues
185 when the change lands:
131 186
132 187 ```sh
133 vole change update 43 --closes 42
134 vole change update 43 --closes 42 --closes 44
135 vole change update 43 --no-closes
188 vole change update 2 --closes 1
189 vole change update 2 --closes 1 --closes 3
190 vole change update 2 --no-closes
136 191 ```
137 192
138 Each update replaces the list. The flag accepts an issue number or ULID and
139 stores the full ULID. Linking does not close the issue immediately, and closing a
140 request without merging leaves its issues open. Only an open request's author or
141 a maintainer can change the list.
193 Each update replaces the complete list. `--closes` accepts an issue number or
194 ULID and stores the full ULID. Linking does not close an issue immediately, and
195 closing a request without merging leaves its issues open. Only an open request's
196 author or a maintainer can change the list.
142 197
143 198 Instance admins can require at least one linked issue for new requests:
144 199
@@ -148,41 +203,213 @@ vole admin acl require-issues enable demo
148 203
149 204 Existing requests are unaffected when this policy changes.
150 205
206 ## Close a request without merging
207
208 Close a request you do not intend to land, or reopen it to continue:
209
210 ```sh
211 vole change close 2
212 vole change reopen 2
213 ```
214
215 Closing without merging leaves linked issues open and does not move the base
216 branch.
217
151 218 ## Stack dependent requests
152 219
153 Open the upper request against the lower branch to isolate its diff:
220 With both branches pushed, open the upper request against the lower branch to
221 isolate its diff:
154 222
155 223 ```sh
156 224 vole change new --title "Add ranking" \
157 --base fix-search --head add-ranking -m "Depends on the empty-index fix."
225 --base fix-search --head add-ranking \
226 -m "Depends on the empty-index fix."
158 227 ```
159 228
160 229 After the lower request lands, retarget the upper request:
161 230
162 231 ```sh
163 vole change update 44 --base main
232 vole change update 3 --base main
164 233 ```
165 234
166 235 Retargeting changes the diff and invalidates earlier approvals.
167 236
168 237 ## Configure review policy
169 238
170 Instance admins manage protected branches and their requirements:
239 Instance admins can protect branches and require approvals and CI:
171 240
172 241 ```sh
173 242 vole admin acl protect add demo refs/heads/main
174 vole admin acl set-approvals demo 2
243 vole admin acl set-approvals demo 1
175 244 vole admin acl checks enable demo
176 245 ```
177 246
178 Admins can push protected branches directly; Vole records merges through review
179 in `data/audit.log`. Required checks count only results from accounts with the
180 `runner` role; maintainers and admins count implicitly. See
181 [Who can run jobs and report results](runner.md#who-can-run-jobs-and-report-results).
247 Admins can push protected branches directly. Merges through review and privileged
248 overrides are recorded in `data/audit.log`. Required checks count only results
249 from accounts with the `runner` role; maintainers and admins count implicitly.
250 See [Who can run jobs and report results](runner.md#who-can-run-jobs-and-report-results).
251
252 ## Change-request semantics
253
254 A change request connects a base branch, a proposed head, review records, and CI
255 results. This section defines the storage and validation rules behind the
256 workflow above.
257
258 ### Storage layout
259
260 ```text
261 changes/<ulid>/change.md
262 changes/<ulid>/comments/<ulid>.md
263 changes/<ulid>/approvals/<account-name>.md
264 ```
265
266 `change.md` records the title, state, author, base, head, followed head ref, and
267 `closes:` issue IDs. Discussion and approvals use the same metadata branch and
268 pre-receive validation as issues. CI records remain in `data/instance.db`.
269
270 ### Branch following and pinning
271
272 A request opened from a branch stores that branch in `head_ref:` and its current
273 remote tip in `head:`. After every accepted push to the followed branch, Vole
274 moves `head:` to the new tip.
275
276 Vole resolves the branch on the remote. If the local clone is behind, the command
277 records the remote tip and reports that difference on stderr. A branch that exists
278 only locally can be recorded with a warning that it is not yet on the remote.
279
280 A request opened from a bare commit has no followed branch and stays pinned to
281 that commit. For an open request:
282
283 - `vole change update <id> --head <branch>` follows a branch;
284 - `--head <commit>` pins one commit;
285 - `--base <branch>` changes the review's target and diff.
286
287 Deleting a followed branch leaves its last observed commit in `head:`, and the
288 request page reports that the branch is gone.
289
290 Contributors can propose only branches below
291 `refs/heads/contrib/<account>/`. Maintainers and admins can propose ordinary
292 shared branches. The browser and pre-receive hook apply the same restriction.
293
294 ### Linked issues
295
296 `change.md` stores full issue ULIDs in `closes:`. `--closes` resolves each issue
297 when the request is written and rejects a number that names another change
298 request.
299
300 Landing a merged request closes its linked issues in the same metadata commit.
301 Only an open request can be relinked because a merged request's list records what
302 its merge did. When `require-issues` is enabled, the browser and push gate reject
303 new requests with an empty list; existing requests remain valid.
304
305 ### Approval validity
306
307 An approval names the base branch and proposed head commit. Only the account
308 named by `approvals/<account-name>.md` can create, change, or remove that file.
309 The request's author cannot approve their own request. An admin repair is
310 recorded in the audit log.
311
312 An approval counts only while:
313
314 - its account is active;
315 - the account currently has `maintainer` or `admin` on the repository;
316 - its head is still the request's head;
317 - its base is still the request's base.
318
319 Retiring an approver or reducing its role therefore stops the approval counting
320 without deleting its file. The page marks it **no longer counts**. Moving the
321 head or base invalidates the approval; moving only the base branch's current tip
322 does not, because the approval names the base branch rather than its old commit.
323
324 Browser approvals carry the base and head displayed by the form. Vole refuses an
325 approval submitted after either target moved, preventing an approver from
326 approving a diff they did not see.
327
328 ### Approvals and combined results
329
330 A protected branch accepts the reviewed head directly when it can fast-forward.
331 If the base moved and cannot fast-forward, Vole builds the merge of the current
332 base and reviewed head, tests that combined tree, and lands the commit it tested.
333
334 The combined result:
335
336 - uses workflow files from the merge tree, including changes from the base;
337 - runs when the head is pushed and again when the base moves for a request under
338 review or waiting to merge;
339 - does not deploy the repository's site;
340 - uses the contributor's cache namespace and CI allow decision when derived from
341 a contributor branch.
342
343 The base move does not invalidate the head approval, but the combined result must
344 pass. Once that same merge commit lands, ordinary branch jobs do not repeat work
345 that the combined run already performed. Site deployment still runs on the branch
346 because the combined result never publishes it.
347
348 A hand-created merge push is accepted only when its tree equals a clean merge of
349 the base tip and reviewed head and its combined checks passed. Extra content and
350 manual conflict resolutions are rejected because they were not reviewed under
351 that approval. Use `vole change merge` or the browser's merge action instead.
352
353 Every landing rechecks approval, permission, and combined-result state when the
354 branch moves. The request page reports these combined states:
355
356 - **Passed with the latest main** — the merge can land.
357 - **Testing the merge with the latest main** — merge can wait for the run.
358 - **The combined result failed** — inspect the named run and push a fix.
359 - **Conflicts with the latest main** — resolve the conflict on the head branch.
360
361 Vole checks mergeability with Git without modifying a working copy. If the needed
362 commits or base are unavailable, it reports that the answer is unknown rather
363 than guessing. A merged request retains `merged_base`, the base tip before
364 landing, so its Files tab can still show the reviewed diff.
365
366 ### Queue statuses
367
368 The change list derives one status from the current head, approvals, checks, and
369 mergeability:
370
371 | Status | Meaning |
372 |---|---|
373 | **Waiting on CI approval** | A maintainer has not allowed this contributor tip to run. |
374 | **Waiting on CI jobs** | Checks are queued or running. |
375 | **CI failed** | A check ran and failed against this commit. |
376 | **CI could not run** | The runner could not start the job; rerun after fixing the machine. |
377 | **Waiting for review** | Fewer valid approvals exist than the base requires. |
378 | **Merge conflict** | The head no longer merges cleanly into the base. |
379 | **Ready to merge** | Required approvals and checks are satisfied. |
380 | **Merged** / **Closed** | The request landed or was closed without landing. |
381
382 The list sorts by the newest metadata commit in each request directory, including
383 edits, comments, and approvals.
384
385 ### Review comments
386
387 A general comment belongs to the request discussion. A line comment also records
388 its path, line, old or new side, and source blob. The web interface shows it in
389 both Conversation and Files and marks it outdated when the file changes.
390
391 Conversation comments use `#c-<ulid>` anchors; line comments in Files use
392 `#inline-c-<ulid>`. A conversation excerpt reads the exact blob named by the
393 comment, so later edits do not change the reviewed context.
394
395 Comments support replies, one-level display nesting, editing, and deletion. Only
396 the author can edit or delete a comment; an admin override is audited. Deletion
397 leaves a tombstone for replies and does not erase Git history.
398
399 ### Protected branches
400
401 Protected-branch patterns are exact refs such as `refs/heads/main` or prefixes
402 ending in one `*`, such as `refs/heads/release/*`. Invalid patterns are rejected
403 rather than stored without effect.
404
405 `set-approvals` controls the number of valid approvals; `0` means admin-only.
406 `checks enable` additionally requires passing trusted CI results. Admins can push
407 protected branches directly. Merges through review and privileged overrides are
408 recorded in `data/audit.log`.
182 409
183 410 ## Next
184 411
185 - [Change-request semantics](reference/change-requests.md) — branch following,
186 approval validity, combined results, and queue statuses.
187 412 - [Workflows](workflows.md) — run the checks a protected branch requires.
188 - [CLI reference](cli.md#change-requests) — look up every change command and option.
413 - [Issues](issues.md) — link the work a request closes.
414 - [CLI reference](cli.md#change-requests) — look up every change command and
415 option.