gunk-dev/the-valley

review.txt

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