gunk-dev/the-valley

review.txt

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