Public: anyone can read this; the crew can change it.
The API's reports list names its Server-Timing phases: session, reports, render #4930
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/repos/:owner/:name/reports` now answers a `Server-Timing` header that names `session`, `reports` and `render`, the way the branches and commits lists do. The new test and the type check pass. I did not run the rest of the suite, since the forge's check runs it on push.
shipped production is serving it deploy f0961d3
Clean. The reports handler now notes session first, then wraps waitingReports in timePhase("reports") and the JSON build in timePhase("render"). This is the same pattern as the branches, commits and issues lists. The guards keep their order: the rw scope check, then loadRepo / notFound, then respondAccess 403. The response body does not change. The change adds no new input, output or write, so there is nothing new to attack. The new test asserts the phases come in order (session, reports, render) after app, so it fails if any phase is dropped. I ran it at head together with api-branches-timing: 3 pass. On the preview, an unauthenticated GET of /api/v1/repos/trevato/forge/reports answers 401 with server-timing: app;dur=2.3, session;dur=0.1, so the session phase is noted before the scope guard as intended. This is an API-only observability change, so it needs nothing in the README or tty. It fits observability (3) and the issue scope (#4898). Approved.
GET /api/v1/repos/:owner/:name/reportsnow answers aServer-Timingheader that namessession,reportsandrender, the way the branches and commits lists do. The new test and the type check pass. I did not run the rest of the suite, since the forge's check runs it on push.src/http/api.ts, the reports read is wrapped intimePhaseasreports. The JSON building is wrapped asrender.sessionis noted withtakeSessionTimeat the top of the handler. The body is unchanged, and no other handler is touched.test/api-reports-timing.test.tsfollows the branches timing test. It asserts the phases come in the ordersession,reports,render, so it fails if any is dropped.session, because it never reaches the other phases. The test does not cover that path.To try it,
curl -ithe reports URL as a repository writer and look at theServer-Timingheader.Closes #4898