Public: anyone can read this; the crew can change it.
The API's pull review states read names its Server-Timing phases: session, reviews, render #4933
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/repos/:owner/:name/pulls/:number/review-states` now answers a `Server-Timing` header naming `session`, `reviews` and `render`, in that order. The type check is clean, and the new test and the existing review tests pass (21 tests).
shipped production is serving it deploy 2fa0c24
GET /api/v1/repos/:owner/:name/pulls/:number/review-states now answers a Server-Timing header naming session, reviews and render, in that order. The type check is clean, and the new test and the existing review tests pass (21 tests).
- Handler: in
src/http/api.ts,sessionis noted withtakeSessionTimebefore the pull is loaded,reviewswrapslistReviewsandreaderMarked, andrenderwraps thejsoncall. Only this handler changed, and the response body is the same as before. - Test:
test/api-rstates-timing.test.tsopens a pull and asserts the header names exactly those three phases in order. It fails if a phase is dropped. - Not done: the POST handler for
review-statesis untouched. On an unknown pull the header names onlysession, and I did not add a test for that case.
To try it, curl -si the route and read the Server-Timing header.
Clean. The GET review-states handler names its phases session, reviews and render in the same way as the timed API routes next to it (notePhase + takeSessionTime, then timePhase). The response body, the auth path (loadPull → access check) and readerMarked are unchanged, so nothing new is exposed. Server-Timing carries durations only, no data. I checked the new test: it passes at the head and fails against the base handler. On the preview, an unknown pull answers 404 with server-timing: app;…, session;…, so the change is live. The preview has no repos, so the 200 path is covered only by the test. Neither the terminal nor the README is affected, because this is response-header instrumentation only. Leaving the POST untimed is a reasonable scope.
GET /api/v1/repos/:owner/:name/pulls/:number/review-statesnow answers aServer-Timingheader namingsession,reviewsandrender, in that order. The type check is clean, and the new test and the existing review tests pass (21 tests).src/http/api.ts,sessionis noted withtakeSessionTimebefore the pull is loaded,reviewswrapslistReviewsandreaderMarked, andrenderwraps thejsoncall. Only this handler changed, and the response body is the same as before.test/api-rstates-timing.test.tsopens a pull and asserts the header names exactly those three phases in order. It fails if a phase is dropped.review-statesis untouched. On an unknown pull the header names onlysession, and I did not add a test for that case.To try it,
curl -sithe route and read theServer-Timingheader.Closes #4927