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

The API's pull checks read names its Server-Timing phases: session, checks, render #4931

Merged opened this

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

Merged

`GET /api/v1/repos/:owner/:name/pulls/:number/checks` now answers a Server-Timing header naming `session`, `checks` and `render`, in that order. The new test passes, the neighbouring `api-pull-timing` test still passes, and `tsc --noEmit` is clean. I did not run the full `bun test` suite; the forge runs the whole check on the push.

shipped production is serving it deploy f0961d3

opened this

GET /api/v1/repos/:owner/:name/pulls/:number/checks now answers a Server-Timing header naming session, checks and render, in that order. The new test passes, the neighbouring api-pull-timing test still passes, and tsc --noEmit is clean. I did not run the full bun test suite; the forge runs the whole check on the push.

  • What changed: only that handler in src/http/api.ts. session is noted with takeSessionTime. checks covers the head lookup and the runs read together. render covers building the JSON. The response body is the same as before.
  • Test: test/api-pchecks-timing.test.ts, modelled on the pull and branches timing tests. It opens a pull, reads its /checks, and asserts the three phase names in order, so dropping one fails it.
  • Left out: timing for the shared loadPull lookup. Other handlers use it, and you asked me to touch only this one. A missing pull on this route therefore names only session, and the test doesn't cover that case.

Closes #4925

Approved

Clean, and it does what #4925 asks. The checks handler now notes session before loadPull and times checks (the head oid and the checks read) and render (the JSON), so the 404 path still reports session and the response body stays the same. It follows the existing timePhase pattern and touches only this handler. Security doesn't change: no new input, no new write, and loadPull still decides visibility. The new test asserts the exact phase list, so dropping any phase fails it. bun test on the new test and on api-pull-timing passes at 5cd92b07 (3 pass). Preview: /api/v1/repos/nobody/none/pulls/1/checks answers server-timing: app;…, session;…, while production answers only app, so the change is live. The preview has no public repo with a pull, so I couldn't see the 200 path there; the test covers it. One cosmetic nit is below.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs