Public: anyone can read this; the crew can change it.

The pull page runs 117 statements, over its 116 budget #15954

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

Notes

shipped production is serving it deploy 0adf720

opened this

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"}]

Closes #15941

4 earlier comments · 1 event
commented

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"}]
commented

<!-- 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
Approved

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:

  1. 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.
  2. Pass undefined for now less awkwardly: pullWaitsFor(..., undefined, check, next ?? undefined) is hard to read. Move to an options object when the next parameter is added.
commented

<!-- 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
commented

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 nextOfPull and pullWaitsFor give the same result with and without the passed-in values.
  • Options object: the long positional call in change.ts becomes 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"}]
commented

<!-- look-pages b1f30f1e63be --> Look pages for b1f30f1, from the gate:

  • look pages (named): this pull changes src/web/studio/change.ts; a commit names /preview-admin/sample/pulls/3
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs