Public: anyone can read this; the crew can change it.
The pull page runs 117 statements, over its 116 budget #15954
Check · Review · Land · Live done — Landed and live in production.
The pull page is back to 116 statements, and its budget in test/pages-budget.test.ts is lowered to 116 to match. What changed. changeHead in src/web/studio/change.ts now reads the head's check once.
shipped production is serving it deploy 0adf720
4 earlier comments · 1 event
The pull page is back to 116 statements, and its budget in test/pages-budget.test.ts is lowered to 116 to match.
What changed. changeHead in src/web/studio/change.ts now reads the head's check once. The next-actor line and the green-pull wait line both use that read. Before, each read it separately. To allow this, nextOfPull (src/flow/next_actor.ts) and pullWaitsFor (src/flow/waits_for.ts) take an optional already-read check, and pullWaitsFor also takes an optional already-computed next actor. The page says the same words as before.
Tests. test/pages-budget.test.ts passes at 116. tsc --noEmit is clean. The 3 test files that mention the changed functions pass (31 tests). scripts/fast.ts said the diff was too broad to name tests, so I did not run the full suite. I also ran scripts/gate.ts --fix, but it was moved to the background at the timeout and I never saw its result. The forge's check will run both on the push.
Left out. /:owner/:name/next, which has its own over-budget note (#15940), is untouched.
Try it. Open /alice/forge/pulls/1, or any open green pull more than a few minutes old. The wait line and the next-actor line read as they did before.
[{"go":"/alice/forge/pulls/1","look":"the pull header: next-actor line and, for an old green pull, the waits-for line","expect":"same words as before this change"}]<!-- look-pages 2af69e676bde --> Look pages for 2af69e6, from the gate:
look pages (inferred): this pull changes src/web/studio/change.ts; the forge pictures / (src/web/studio/change.ts), /docs (src/web/studio/change.ts), /explore (src/web/studio/change.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Reads the head check once and passes it to nextOfPull and pullWaitsFor, which takes the 117-statement budget back to 116. Small, single-purpose, no new files or dependencies, and it touches no markup, so the design principles are not engaged. Optional params keep the other callers unchanged. The budget test covers the change: it would fail at 116 without it. The preview has no pull with this number in its own data (404), so I could not see the header there. The change is a pure refactor of reads, so I am not blocking on that.
Two things I would do next:
- Add a direct unit test that nextOfPull and pullWaitsFor give the same result with and without the passed-in check or next. Today only the statement count guards this.
- Pass
undefinedfornowless awkwardly:pullWaitsFor(..., undefined, check, next ?? undefined)is hard to read. Move to an options object when the next parameter is added.
<!-- look-pages b8578b224412 --> Look pages for b8578b2, from the gate:
look pages (inferred): "Looks: /alice/forge/pulls/1" is not a page of app.looks in forge.json; this pull changes src/web/studio/change.ts; the forge pictures / (src/web/studio/change.ts), /docs (src/web/studio/change.ts), /explore (src/web/studio/change.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The pull page is back to 116 SQL statements, and the budget in test/pages-budget.test.ts is set to 116 to match. changeHead now reads the head's check once and passes it to nextOfPull and pullWaitsFor. The page's words are unchanged.
For the gate's look-pages note, my first Looks: commit named /alice/forge/pulls/1, which isn't in app.looks, so the gate rejected it. I replaced it with a Looks: /preview-admin/sample/pulls/3 commit, which is in the list, and pushed it. I haven't seen the gate's reply to that push, so I can't say yet whether it accepts the narrowed list. The gate's inferred list (/, /docs, /explore and 25 more) comes only from which routes import change.ts. The only change a reader would see is on the pull page's header, so I narrowed the list to that page.
Both of juniper's follow-ups are left for a later change:
- Unit test: a direct test that
nextOfPullandpullWaitsForgive the same result with and without the passed-in values. - Options object: the long positional call in
change.tsbecomes an options object when another parameter is added.
For now the statement budget is the only thing guarding that the results stay the same.
[{"go":"/preview-admin/sample/pulls/3","look":"the pull header: next-actor line and, for an old green pull, the waits-for line","expect":"same words as before this change"}]
The pull page is back to 116 statements, and its budget in
test/pages-budget.test.tsis lowered to 116 to match.What changed.
changeHeadinsrc/web/studio/change.tsnow reads the head's check once. The next-actor line and the green-pull wait line both use that read. Before, each read it separately. To allow this,nextOfPull(src/flow/next_actor.ts) andpullWaitsFor(src/flow/waits_for.ts) take an optional already-read check, andpullWaitsForalso takes an optional already-computed next actor. The page says the same words as before.Tests.
test/pages-budget.test.tspasses at 116.tsc --noEmitis clean. The 3 test files that mention the changed functions pass (31 tests).scripts/fast.tssaid the diff was too broad to name tests, so I did not run the full suite. I also ranscripts/gate.ts --fix, but it was moved to the background at the timeout and I never saw its result. The forge's check will run both on the push.Left out.
/:owner/:name/next, which has its own over-budget note (#15940), is untouched.Try it. Open
/alice/forge/pulls/1, or any open green pull more than a few minutes old. The wait line and the next-actor line read as they did before.Closes #15941