gunk-dev/the-valley

review.txt

sourceddfdc45c1aa2main's published tip history
17.9 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 shows the state of its checks and what
31 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 pages how many commits changed, the files whose change
120 differs with the landings that edited them, git
121 range-diff of the two versions, and the shown
122 version's diff of those files, or prints a changed
123 message or author when the files are the same. -v adds
124 each file's mode and SHA-256 in each version. on a
125 terminal, unless NO_COLOR is set, the title, the
126 section headings and the hashes are styled; the buffer
127 the editor opens is plain. this is information only:
128 it files nothing and skips no check.
129 when [a]pprove's checks fail, the prompt says approving
130 needs a new head and stops offering [a]pprove until the
131 change has one. any other refusal keeps the prompt as
132 it was.
133 [a]pprove files the head shown, for a branch no record
134 is on too: it refuses, naming both heads, when the
135 branch on origin has moved off that head since.
136 [a]pprove is the only way a change reaches main from
137 here, and approve (valley help approve) is the same act
138 without the pager.
139 Nothing in review writes the protected ref: the
140 integrator does, having judged the request.
141 a change behind main (one that does not fast-forward
142 from it) is asked the same prompt, under one line:
143 `<branch> is behind main; the integrator lands it
144 onto main as main stands (no rebase needed).`
145 the integrator applies the change's delta onto main as
146 it stands, and the host's restacker rebases ready
147 changes itself, so review asks nothing more of it.
148 while the restacker reports a conflict for the change,
149 the line says `<branch> conflicts with main; its owner
150 is resolving it.` instead. [a]pprove is still offered,
151 and the integrator decides whether the change applies.
152 to rebase a change of your own, use valley rebase.
153 a change whose record is not ready says so above its
154 diff, and again in place of the prompt, which then
155 offers only [v]iew full diff and [s]kip:
156 `<change> v<n> is a draft: its owner (<owner>) hasn't
157 marked it ready, so it can't be approved yet.`
158 `<change> is withdrawn: there is nothing to approve.`
159 a draft is often a change an agent is still working on.
160 [a]pprove would be refused. [r]eject records nothing
161 on the change: it would only delete a branch its owner
162 may still be working on.
163 before [a]pprove or [r]eject acts, review reads the
164 change again. when it moved while you read it, review
165 says what changed in one line, and acts on nothing
166 unless you approve a new version it offers:
167 `<change> changed while you were reviewing: it was
168 returned to draft (since <time>), so there is
169 nothing to approve now. It comes back when it is
170 ready again.`
171 `<change> changed while you were reviewing: it was
172 withdrawn (since <time>), so there is nothing to
173 approve.`
174 `<change> moved to v<n> while you were reviewing
175 (<why>) · [a]pprove v<n>, [v]iew what changed
176 since v<m>, [s]kip?`
177 `<change> landed as v<n> while you were reviewing;
178 there is nothing left to approve.`
179 <time> is when the record last changed, in UTC.
180 a new version with the same changes and commits, such
181 as a restack the carry mode allows, keeps the answer:
182 `<change> moved to v<n> while you were reviewing.
183 v<n> is v<m> rebased onto the new main with no
184 other changes, so your approval covers it.`
185 and [a]pprove files v<m>, the head shown. its verdict
186 names v<n>, which lands, with v<n>'s checks. otherwise
187 <why> says whether the change's commits changed or
188 only main moved under them, and why the answer does
189 not carry. with its commits unchanged, [a]pprove v<n>
190 is offered at once; with a commit changed, only after
191 [v]iew. [a] files v<n>'s head, and is refused if the
192 change moves again first.
193 a branch no record is on has no state, and is offered
194 the usual prompt.
195 while paging, press v: less opens the diff in $EDITOR.
196 every line you insert there is a note. it is anchored to
197 the file and new-side line it sits on — to the file alone
198 when it sits above the first hunk. range-diff gives no
199 line numbers, so set against an approved version a
200 note keeps its file and line only in the section
201 headed `── v<n>'s diff of these files against main`. each note is then appended to
202 $XDG_STATE_HOME/valley/notes/<branch>.md (default
203 ~/.local/state) and printed after the verdict. notes
204 survive a stack's [b]ase onto main. lines you change
205 or delete instead of inserting are ignored, with a
206 warning.
207 a change whose active version names no branch is
208 refused, since notes and [r]eject act on a branch;
209 approve files its head without one.
210 a stack is reviewed one layer at a time, bottom first.
211 a layer below the top that is approved, as pending
212 lists it, is named in the list and not paged: it asks
213 nothing of you. the top is always paged.
214 its layers are what pending lists under the change: the
215 changes not landed and the branches no record is on
216 that its head contains. review first
217 lists them, warns of a lower layer that is a draft or
218 withdrawn, since the integrator lands nothing above it,
219 and says how the review goes: [n] through the layers,
220 and approving the top lands them all. a stack whose
221 bottom does not fast-forward from main is then asked,
222 before any layer is paged, under `<top> · stack of <n>
223 · behind main`:
224 [b]ase onto main
225 rebase the whole stack onto origin/main,
226 as rebase does (valley help rebase), then
227 list it again and page the rebased layers,
228 so the heads paged are the heads approved
229 [v]iew diff page the top's whole diff against main
230 [s]kip end the review; nothing done
231 a rebase that is refused or left unfinished says what
232 happened, and then only [v]iew diff and [s]kip are
233 offered.
234 it then shows each layer, headed `change <k> of <n>:
235 <name> on <below>`, as a change alone is shown: set
236 against its own change's approved version, or its log
237 and diff against the layer below it paged, with notes
238 kept under that layer's branch.
239 after each lower layer it asks, naming the layer and
240 its place, as in `two, 2 of 3:`:
241 [n]ext layer go on to the layer above; the usual
242 answer
243 [a]pprove approve that layer at the head shown,
244 as review of it would. this lands it
245 and every layer under it, which the
246 prompt names (`one alone`, `one and
247 two`, `the <k> up to <name>`), and
248 ends the review
249 [v]iew full diff
250 page that layer's log and diff against
251 the layer below it, and ask again
252 [s]top end the review; nothing done
253 after the top it asks, as in `three, 3 of 3:`:
254 [a]pprove all <n>
255 approve the top at the head shown,
256 which lands every layer
257 [v]iew full diff
258 page the top's log and diff against
259 the layer below it, and ask again
260 [r]eject <name>
261 delete the top's branch (confirmed
262 first)
263 [s]top end the review; nothing done
264 only the top is offered [r]eject. when a layer's checks
265 fail, its prompt says approving needs a new head and
266 stops offering [a]pprove, as for any change. a layer
267 that is not ready says so as a change alone does, under
268 its heading and in its prompt. neither it nor any layer
269 above it is offered [a]pprove, since approving one would
270 land it: each prompt above it says `it would bring
271 <name>, change <k> of <n>, which is a draft` (or
272 withdrawn) in its place. a top that is not ready is not
273 offered [r]eject either. every layer's notes are printed
274 at the end.