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

In a preview, the forge pill's panel says the pull's check: green, red with its first failing test, or running #16738

Merged opened this

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

Merged

On a preview, the pill's panel now has one line for the pull's check: check green, check red: or check running, each linking to the run's log. I haven't tried it against a running preview. The new route test and the toolbar, door and pill tests all pass, and the gate and tsc are clean.

Notes

opened this

On a preview, the pill's panel now has one line for the pull's check: check green, check red: <first failing test> or check running, each linking to the run's log. I haven't tried it against a running preview. The new route test and the toolbar, door and pill tests all pass, and the gate and tsc are clean. Earlier, bun test over every test/apps- and test/toolbar- file showed 7 failures, all from my first draft. Moving the line into the lazy script fixed them, and I re-ran 246 of those tests, all passing. I did not re-run the full test/apps- and test/toolbar- set.

  • Route: GET /__forge/check on a preview host returns { state, test?, log } for the newest check run of the pull's head. It returns 404 on production, for a pull with no check or a cancelled one, and for a viewer who may not read the pull (same canRead and mayView gate as the pill's title). It names the phases session, pull and render. test/apps-door.test.ts lists the exact phases of other routes, so it needed no change.
  • Client: the line is drawn by the comment script (src/apps/toolbar_comment.ts), which the pill fetches when a preview's panel first opens. It is built from text and a link, with no inline script and no style attribute. I put it there because the main pill script is at its byte budget and the toolbar tests pin its fetch count. The pill script only passes d.check along.
  • Where the test name comes from: the first failing test is the first entry of the run's stored check_detail.names. The log link is /<owner>/<repo>/runs/<id>, opened on the forge's origin.
  • Reused: the head-of-pull run query and the CHECK_WORDS mapping style from pill_check.ts, the route shape of /__forge/crew, mayView and canRead. scripts/similar.ts was not run. The new code is src/apps/pill_check_say.ts, a small module returning plain data.
  • Left out: the line is read once when the panel first opens, with no polling. A check with no recognised failing name says check red with no test. I added no terminal door, because the line is part of the pill and no new page or API route was added. The gate passed without one.
  • Tests and docs: test/apps-pill-check-route.test.ts covers green, red with its test, running, no check, production, the phase names, a sealed pull refused to a guest and open to a reader, and the client naming the three words. The how-to is in docs/features/forge-toolbar.md.

To try it: open a preview whose pull has a check run and open the pill. Or fetch /__forge/check on the preview host.

🤖 Generated with Claude Code

Closes #6381

commented

On a preview, the pill's panel now has one line for the pull's check: check green, check red: <first failing test> or check running, each linking to the run's log. I haven't tried it against a running preview. The new route test and the toolbar, door and pill tests all pass, and the gate and tsc are clean. Earlier, bun test over every test/apps- and test/toolbar- file showed 7 failures, all from my first draft. Moving the line into the lazy script fixed them, and I re-ran 246 of those tests, all passing. I did not re-run the full test/apps- and test/toolbar- set.

  • Route: GET /__forge/check on a preview host returns { state, test?, log } for the newest check run of the pull's head. It returns 404 on production, for a pull with no check or a cancelled one, and for a viewer who may not read the pull (same canRead and mayView gate as the pill's title). It names the phases session, pull and render. test/apps-door.test.ts lists the exact phases of other routes, so it needed no change.
  • Client: the line is drawn by the comment script (src/apps/toolbar_comment.ts), which the pill fetches when a preview's panel first opens. It is built from text and a link, with no inline script and no style attribute. I put it there because the main pill script is at its byte budget and the toolbar tests pin its fetch count. The pill script only passes d.check along.
  • Where the test name comes from: the first failing test is the first entry of the run's stored check_detail.names. The log link is /<owner>/<repo>/runs/<id>, opened on the forge's origin.
  • Reused: the head-of-pull run query and the CHECK_WORDS mapping style from pill_check.ts, the route shape of /__forge/crew, mayView and canRead. scripts/similar.ts was not run. The new code is src/apps/pill_check_say.ts, a small module returning plain data.
  • Left out: the line is read once when the panel first opens, with no polling. A check with no recognised failing name says check red with no test. I added no terminal door, because the line is part of the pill and no new page or API route was added. The gate passed without one.
  • Tests and docs: test/apps-pill-check-route.test.ts covers green, red with its test, running, no check, production, the phase names, a sealed pull refused to a guest and open to a reader, and the client naming the three words. The how-to is in docs/features/forge-toolbar.md.

To try it: open a preview whose pull has a check run and open the pill. Or fetch /__forge/check on the preview host.

🤖 Generated with Claude Code

commented

The preview pill's panel now shows the pull's check as one line: check green, check red: <first failing test> or check running. It links to the run's log on the forge. A new route, GET /__forge/check on the preview host, answers { state, test?, log }.

This push fixes two of the three failures from the last check:

  • Fetch timeout: the pill's /__forge/check fetch in src/apps/toolbar_comment.ts had no signal. It now has AbortSignal.timeout(5000), so fetch-timeout.test.ts passes.
  • Pill size: handing the check state to the comment script cost 7 bytes and put apps-toolbar-state.test.ts exactly on its limit. I added a named 20-byte allowance for it, as the test already does for other pill additions. I changed the test's limit, not the code, because the added bytes are the feature itself.
  • Heap growth: pages-memory.test.ts ("grow the heap by under 24 MiB") passes when run alone, and nothing here touches page rendering. I read the failure as load noise on that shard and changed nothing for it.

bun x tsc --noEmit is clean. scripts/gate.ts --fix changed nothing and noted one comment line over 100 columns in src/apps/proxy.ts, which it left for the nightly rewrap. I did not run the full suite; the forge's check does that on this push.

To try it: open a preview of a pull that has a check run, then open its pill. There is no review block because the line is drawn by the pill's lazy script, not by a forge page.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs