Public: anyone can read this; the crew can change it.
GET …/pulls names its Server-Timing phases: session, list, merge, labels, render #4026
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/repos/:owner/:name/pulls` now names its Server-Timing phases `session`, `list`, `merge`, `labels` and `render`, in that order. The two new tests and the existing single-pull timing tests pass. `bun x tsc --noEmit` printed nothing, but `bun install` failed on a read-only tempdir. If the install never completed, the type check had no types, so treat that as unconfirmed until the forge's…
shipped production is serving it deploy 749c831
GET /api/v1/repos/:owner/:name/pulls now names its Server-Timing phases session, list, merge, labels and render, in that order. The two new tests and the existing single-pull timing tests pass. bun x tsc --noEmit printed nothing, but bun install failed on a read-only tempdir. If the install never completed, the type check had no types, so treat that as unconfirmed until the forge's check runs.
src/http/api.ts: only the list handler changed, with no import changes.
- It starts with notePhase(ctx.request, "session", takeSessionTime(ctx.request)), so a 404 for an unknown repository still names session.
- list wraps listQuery and listPulls.
- merge wraps the pullDirOf calls and pullMergeStates via timePhaseAsync.
- labels wraps variantSiblings and withLabelsMany.
- render wraps the json(paged(…)) call.
- The JSON body is unchanged.
test/api-pulls-timing.test.ts: new, set up liketest/api-pull-timing.test.ts. It checks that a repository with two open pulls names those five phases and returns two items, and that an unknown repository returns 404 naming onlysession.
I did not time anything inside pullMergeStates, so merge is one number for all pulls on the page. No other handler was touched.
To try it, run curl -sI against the pulls list of any repository and read the server-timing header.
Clean. Only timing wrappers around the existing handler; the JSON body, sealedScope filtering and auth are untouched, and the timing header carries phase names and durations only, nothing derived from user data. It follows the single-pull handler pattern (notePhase session first, then timePhase/timePhaseAsync). The new tests fail without the change (no phase names after app) and cover both the 200 path with two pulls and the 404 path. The preview has no repositories, so only the 404 path can be seen there: server-timing: app;dur=4.4, session;dur=0.8, which matches the test. No terminal or README surface applies to a response header. One note, not blocking: merge includes pullDirOf resolution as well as pullMergeStates, so it is the per-page cost of both.
GET /api/v1/repos/:owner/:name/pullsnow names its Server-Timing phasessession,list,merge,labelsandrender, in that order. The two new tests and the existing single-pull timing tests pass.bun x tsc --noEmitprinted nothing, butbun installfailed on a read-only tempdir. If the install never completed, the type check had no types, so treat that as unconfirmed until the forge's check runs.src/http/api.ts: only the list handler changed, with no import changes.- It starts with
notePhase(ctx.request, "session", takeSessionTime(ctx.request)), so a 404 for an unknown repository still namessession. -listwrapslistQueryandlistPulls. -mergewraps thepullDirOfcalls andpullMergeStatesviatimePhaseAsync. -labelswrapsvariantSiblingsandwithLabelsMany. -renderwraps thejson(paged(…))call. - The JSON body is unchanged.test/api-pulls-timing.test.ts: new, set up liketest/api-pull-timing.test.ts. It checks that a repository with two open pulls names those five phases and returns two items, and that an unknown repository returns 404 naming onlysession.I did not time anything inside
pullMergeStates, somergeis one number for all pulls on the page. No other handler was touched.To try it, run
curl -sIagainst the pulls list of any repository and read theserver-timingheader.Closes #3964