gunk-dev/the-valley

review.txt

sourced9f7bacd171bmain's published tip history
18.6 KiB
1usage: valley review [-v] [--build-here] [<approval key>] <change>
2 valley review [-v] [--build-here] [<approval key>] [--repo <name>]
3
4 <approval key> is --approval-key <file> or --approval-piv: [a]pprove
5 signs each approval with it, as approve does (valley help approve).
6
7 review [-v] [--build-here] [--repo <name>]
8 with no change, review each change that needs you, as
9 valley pending --all lists them, in landing order, or
10 those of the project --repo names. each step opens
11 with `[1/3] <project> · <handle> v<N> · <checks>` and
12 is the review below, run where the project is read:
13 this checkout, or the clone valley keeps of another
14 project, lent this checkout's valley.principal,
15 user.name and user.email. a change that landed, is
16 not ready or has no branch since is not reviewed; one
17 at a new version is reviewed at it. the walk ends with
18 each change's outcome and what still needs you. a
19 project that did not read is said first and last. a
20 change in a project whose main names another valley
21 ends in error: review it from that valley's checkout.
22 ctrl-c or SIGTERM ends the walk with what it walked,
23 exit 130.
24
25 review [-v] [--build-here] <change>
26 page through the change's branch: its log, with each
27 commit's whole message, and diff vs origin/main, or a
28 stack layer by layer (below). above
29 each change's diff, review shows every knot in the plan
30 graph that links the change, as `does oc-6335749 (open):
31 <title>`. a missing or unreadable graph
32 shows no knots; -v warns on stderr. before the prompt, a
33 ready change or a draft shows the state of its checks and
34 what they cost the host's check worker to build, as pending
35 --checks shows it: `checks: 21 passed in 9m10s (eval
36 24s); worker-e2e 431s, +100s against its recent 331s`,
37 or `checks: 20 passed, 1 pending (worker-e2e failed in
38 the worker's build, 5m ago)`.
39 review reads them while it shows the diff and never
40 waits for them: a line not read by the prompt is not
41 shown, unless VALLEY_REVIEW_CHECKS_WAIT=<seconds> says
42 how long to wait for it. checks that cannot be read show no line; -v
43 warns on stderr. the prompt is one header line, the
44 change and its state, `nqyw v3 · checks: 4 passed ·
45 behind main (integrator merges)`, then the keys it
46 takes; a change that can't be approved says why in the
47 header and is not offered [a]pprove. -v also passes -v
48 to approve. then choose:
49 [a]pprove file an integration request for the
50 head shown, as approve does (valley
51 help approve). it reuses the evidence
52 origin holds for the checks the
53 composed policy requires of this
54 change. when a required nix check has
55 none, it files the request at once
56 all the same, builds nothing, and
57 names the check. when evidence is
58 published, the integrator considers
59 the request again; it may never be
60 published. given
61 --build-here, review's [a]pprove builds
62 those nix checks here instead. it runs
63 the command checks, and any nix check
64 it builds, over a throwaway worktree of
65 that head, signs each result as an
66 attestation, and publishes the evidence
67 and the request ref to origin in ONE
68 atomic push. this files the request;
69 it does not wait for integration or
70 update your local checkout. use status
71 to read the result. the policy comes
72 from the target's tip and the owning
73 valley's, as checks describes (valley
74 help checks), so your checkout
75 can be on any branch. a change the policy
76 requires no check of is filed too, as a
77 request with no evidence, and says so.
78 approving a change already requested is
79 how it is filed again. at a head rebased
80 onto a moved main it replaces the request
81 ref under a lease and names the head it
82 replaced; at the same head it leaves the
83 ref alone and publishes only the new
84 evidence, which origin refuses when
85 this signer has already attested that
86 tree: approve publishes a signer's
87 evidence for a tree once (bd-7b7d58f). every write of the request
88 ref is leased, filing included, so an
89 approval that lost a race is refused
90 rather than clobbering the one that won.
91 needs the attest helper whenever a
92 check is required, and
93 VALLEY_ATTEST_KEY, the ed25519 key this
94 host signs with, whenever a check runs
95 here; VALLEY_ATTEST_NAME is the name it
96 signs under, defaulting to this host's.
97 [v]iew full diff
98 page the change's whole diff, with
99 notes taken as below, and ask again
100 [r]eject delete the remote branch (confirmed first)
101 [s]kip do nothing
102 a change with a record is first set against its
103 approved version: the greatest version below the one
104 shown whose exact head an integration request or a
105 land, stale or reject outcome on origin names, under
106 c-<change id> or a branch name of the change that
107 nothing else maps to. with none,
108 or an ambiguous one, review pages the whole diff. its
109 first line says what changed since you approved v<m>:
110 `<change> v<n> at <head>: rebased since you approved
111 v<m> at <old head>, with the same file changes.`
112 each version's diff from its merge base with main
113 changes the same files the same way (valley-delta-v1).
114 review prints the commits main landed between the
115 bases, and pages nothing.
116 `... rebased since you approved v<m> at <old head>.`
117 the commits are the same patches, messages and
118 authors, but main also edited files the change edits.
119 review pages each file whose change differs, with the
120 landings that edited it, then the shown version's diff
121 of those files.
122 `... edited since you approved v<m> at <old head>.`
123 a commit's patch, message or author differs. review
124 carries v<m> onto main as the integrator would, and
125 pages how many commits changed; the files whose change
126 differs, as carried unchanged, changed since v<m>, or
127 in conflict with main with the landings that edited
128 them; the diff of what v<n> changes beyond v<m> carried
129 onto main; and, for each path in conflict, v<n>'s
130 resolution of the conflict markers, or each version's
131 own diff of the path. a changed message prints as a
132 line diff, a changed author in full. -v adds the
133 landings of every file, each file's mode and SHA-256
134 in each version, and git range-diff of the two
135 versions. on a
136 terminal, unless NO_COLOR is set, the title, the
137 section headings and the hashes are styled; the buffer
138 the editor opens is plain. this is information only:
139 it files nothing and skips no check.
140 when [a]pprove's checks fail, the prompt says approving
141 needs a new head and stops offering [a]pprove until the
142 change has one. any other refusal keeps the prompt as
143 it was.
144 [a]pprove files the head shown, for a branch no record
145 is on too: it refuses, naming both heads, when the
146 branch on origin has moved off that head since.
147 [a]pprove is the only way a change reaches main from
148 here, and approve (valley help approve) is the same act
149 without the pager.
150 Nothing in review writes the protected ref: the
151 integrator does, having judged the request.
152 a change behind main (one that does not fast-forward
153 from it) is asked the same prompt, under one line:
154 `<branch> is behind main; the integrator lands it
155 onto main as main stands (no rebase needed).`
156 the integrator applies the change's delta onto main as
157 it stands, and the host's restacker rebases ready
158 changes itself, so review asks nothing more of it.
159 while the restacker reports a conflict for the change,
160 the line says `<branch> conflicts with main; its owner
161 is resolving it.` instead. [a]pprove is still offered,
162 and the integrator decides whether the change applies.
163 to rebase a change of your own, use valley rebase.
164 a change whose record is not ready says so above its
165 diff, and again in place of the prompt, which then
166 offers only [v]iew full diff and [s]kip:
167 `<change> v<n> is a draft: its owner (<owner>) hasn't
168 marked it ready, so it can't be approved yet.`
169 `<change> is withdrawn: there is nothing to approve.`
170 a draft is often a change an agent is still working on.
171 [a]pprove would be refused. [r]eject records nothing
172 on the change: it would only delete a branch its owner
173 may still be working on.
174 before [a]pprove or [r]eject acts, review reads the
175 change again. when it moved while you read it, review
176 says what changed in one line, and acts on nothing
177 unless you approve a new version it offers:
178 `<change> changed while you were reviewing: it was
179 returned to draft (since <time>), so there is
180 nothing to approve now. It comes back when it is
181 ready again.`
182 `<change> changed while you were reviewing: it was
183 withdrawn (since <time>), so there is nothing to
184 approve.`
185 `<change> moved to v<n> while you were reviewing
186 (<why>) · [a]pprove v<n>, [v]iew what changed
187 since v<m>, [s]kip?`
188 `<change> landed as v<n> while you were reviewing;
189 there is nothing left to approve.`
190 <time> is when the record last changed, in UTC.
191 a new version with the same changes and commits, such
192 as a restack the carry mode allows, keeps the answer:
193 `<change> moved to v<n> while you were reviewing.
194 v<n> is v<m> rebased onto the new main with no
195 other changes, so your approval covers it.`
196 and [a]pprove files v<m>, the head shown. its verdict
197 names v<n>, which lands, with v<n>'s checks. otherwise
198 <why> says whether the change's commits changed or
199 only main moved under them, and why the answer does
200 not carry. with its commits unchanged, [a]pprove v<n>
201 is offered at once; with a commit changed, only after
202 [v]iew. [a] files v<n>'s head, and is refused if the
203 change moves again first.
204 a branch no record is on has no state, and is offered
205 the usual prompt.
206 while paging, press v: less opens the diff in $EDITOR.
207 every line you insert there is a note. it is anchored to
208 the file and new-side line it sits on — to the file alone
209 when it sits above the first hunk. set against an
210 approved version, a note keeps its file and line in
211 every diff on the page; range-diff, which -v adds,
212 gives no line numbers. each note is then appended to
213 $XDG_STATE_HOME/valley/notes/<branch>.md (default
214 ~/.local/state) and printed after the verdict. notes
215 survive a stack's [b]ase onto main. lines you change
216 or delete instead of inserting are ignored, with a
217 warning.
218 a change whose active version names no branch is
219 refused, since notes and [r]eject act on a branch;
220 approve files its head without one.
221 a stack is reviewed one layer at a time, bottom first.
222 a layer below the top that is approved, as pending
223 lists it, is named in the list and not paged: it asks
224 nothing of you. the top is always paged.
225 its layers are what pending lists under the change: the
226 changes not landed and the branches no record is on
227 that its head contains. review first
228 lists them, warns of a lower layer that is a draft or
229 withdrawn, since the integrator lands nothing above it,
230 and says how the review goes: [n] through the layers,
231 and approving the top lands them all. a stack whose
232 bottom does not fast-forward from main is then asked,
233 before any layer is paged, under `<top> · stack of <n>
234 · behind main`:
235 [b]ase onto main
236 rebase the whole stack onto origin/main,
237 as rebase does (valley help rebase), then
238 list it again and page the rebased layers,
239 so the heads paged are the heads approved
240 [v]iew diff page the top's whole diff against main
241 [s]kip end the review; nothing done
242 a rebase that is refused or left unfinished says what
243 happened, and then only [v]iew diff and [s]kip are
244 offered.
245 it then shows each layer, headed `change <k> of <n>:
246 <name> on <below>`, as a change alone is shown: set
247 against its own change's approved version, or its log
248 and diff against the layer below it paged, with notes
249 kept under that layer's branch.
250 after each lower layer it asks, naming the layer and
251 its place, as in `two, 2 of 3:`:
252 [n]ext layer go on to the layer above; the usual
253 answer
254 [a]pprove approve that layer at the head shown,
255 as review of it would. this lands it
256 and every layer under it, which the
257 prompt names (`one alone`, `one and
258 two`, `the <k> up to <name>`), and
259 ends the review
260 [v]iew full diff
261 page that layer's log and diff against
262 the layer below it, and ask again
263 [s]top end the review; nothing done
264 after the top it asks, as in `three, 3 of 3:`:
265 [a]pprove all <n>
266 approve the top at the head shown,
267 which lands every layer
268 [v]iew full diff
269 page the top's log and diff against
270 the layer below it, and ask again
271 [r]eject <name>
272 delete the top's branch (confirmed
273 first)
274 [s]top end the review; nothing done
275 only the top is offered [r]eject. when a layer's checks
276 fail, its prompt says approving needs a new head and
277 stops offering [a]pprove, as for any change. a layer
278 that is not ready says so as a change alone does, under
279 its heading and in its prompt. neither it nor any layer
280 above it is offered [a]pprove, since approving one would
281 land it: each prompt above it says `it would bring
282 <name>, change <k> of <n>, which is a draft` (or
283 withdrawn) in its place. a top that is not ready is not
284 offered [r]eject either. every layer's notes are printed
285 at the end.