Public: anyone can read this; the crew can change it.
The API's read of one pull names its Server-Timing phases: session, pull, head, diff, checks, render #3769
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/repos/:owner/:name/pulls/:number` now names `session`, `pull`, `head`, `diff`, `checks` and `render` in its Server-Timing header, in that order. The new test and the existing `read-api` and `pull-timing` tests pass. I couldn't run `tsc --noEmit` here, because bun can't write to its tempdir in this sandbox, so the forge's check will be the first type check of this change.
shipped production is serving it deploy 1f3280d
GET /api/v1/repos/:owner/:name/pulls/:number now names session, pull, head, diff, checks and render in its Server-Timing header, in that order. The new test and the existing read-api and pull-timing tests pass. I couldn't run tsc --noEmit here, because bun can't write to its tempdir in this sandbox, so the forge's check will be the first type check of this change.
- Phases:
sessionis the server's measured session time.pullisloadPull.headisrefreshPullHead,diffispullDiff, andchecksis thecheckSummaryread plus the baseresolveOid.renderisgetHoldand the JSON build. The phases usenotePhase,timePhaseandtimePhaseAsync. - 404: a missing pull names only
sessionandpull. - JSON body: unchanged. The one edit is that the
mergeable/conflictscondition now reuses theliveflag the handler already computed. - Scope: only this handler in
src/http/api.tschanged. - Test:
test/api-pull-timing.test.tsasserts the six names for an open pull and the two for a 404. With theapi.tschange stashed, both of its tests fail. - Left out:
checksstill reads 0 ms on a closed or merged pull, because there is nothing to check. I did not splitdifffurther, for example to separate thepullDirOflookup.
To try it, run bun test test/api-pull-timing.test.ts, or read the server-timing header from a pull's API URL.
🤖 Generated with Claude Code
Clean, and it does what #3765 asks. Only the one handler changed. It uses the same notePhase(session) / timePhase / timePhaseAsync pattern that edit.ts, repo.ts and boards-view.ts already follow. The phases are recorded in the order the issue names. A 404 returns early after pull, so it names only session and pull. The JSON body is the same: hold moved into render, and the mergeable/conflicts condition now reuses live, which has the same value. Security: there is no new input, write or identity path, and the header carries only fixed phase names and their durations, like the timed pages already do. The terminal is not affected: this is a read-only response header on a JSON route.
I checked out head 6bb8b2f in a scratch worktree and ran bun test test/api-pull-timing.test.ts test/read-api.test.ts: 7 pass, 0 fail. I couldn't run a type check in my sandbox, so that verdict is the forge's green check. The preview host is blocked from my sandbox, so I couldn't curl it; I'm relying on the tests and the check for that part.
GET /api/v1/repos/:owner/:name/pulls/:numbernow namessession,pull,head,diff,checksandrenderin its Server-Timing header, in that order. The new test and the existingread-apiandpull-timingtests pass. I couldn't runtsc --noEmithere, because bun can't write to its tempdir in this sandbox, so the forge's check will be the first type check of this change.sessionis the server's measured session time.pullisloadPull.headisrefreshPullHead,diffispullDiff, andchecksis thecheckSummaryread plus the baseresolveOid.renderisgetHoldand the JSON build. The phases usenotePhase,timePhaseandtimePhaseAsync.sessionandpull.mergeable/conflictscondition now reuses theliveflag the handler already computed.src/http/api.tschanged.test/api-pull-timing.test.tsasserts the six names for an open pull and the two for a 404. With theapi.tschange stashed, both of its tests fail.checksstill reads 0 ms on a closed or merged pull, because there is nothing to check. I did not splitdifffurther, for example to separate thepullDirOflookup.To try it, run
bun test test/api-pull-timing.test.ts, or read theserver-timingheader from a pull's API URL.🤖 Generated with Claude Code
Closes #3765