GET /api/v1/repos/:owner/:name/pulls (src/http/api.ts, the handler at about line 3594) does git work per pull through pullDirOf and pullMergeStates, but names no Server-Timing phase, so you can't see what the merge check costs.
Read this first:notePhase, takeSessionTime, timePhase and timePhaseAsync are already imported on line 18 of src/http/api.ts. Do not add another import. Both earlier tries (pulls #3783 and #3962) failed the check with TS2300: Duplicate identifier 'timePhaseAsync'. Run bun x tsc --noEmit before you push. The GET …/pulls/:number handler (about line 3712) shows the pattern to copy.
Done:
[ ] The handler begins with notePhase(ctx.request, "session", takeSessionTime(ctx.request)), so a 404 for an unknown repository still names session.
[ ] list wraps listQuery + listPulls; merge (via timePhaseAsync) wraps the pullDirOf calls and pullMergeStates; labels wraps variantSiblings and withLabelsMany; render wraps the json(paged(…)) call.
[ ] The new test/api-pulls-timing.test.ts (copy the setup from test/api-pull-timing.test.ts) checks that the Server-Timing header names session, list, merge, labels and render for a repository with two open pulls, and that a 404 names session. Without the change this test fails. The JSON body is unchanged.
[ ] bun x tsc --noEmit passes.
Files: src/http/api.ts (this one handler only, no import changes), test/api-pulls-timing.test.ts (new).
Risk: small. Touch no other handler.
GET /api/v1/repos/:owner/:name/pulls(src/http/api.ts, the handler at about line 3594) does git work per pull throughpullDirOfandpullMergeStates, but names no Server-Timing phase, so you can't see what the merge check costs.Read this first:
notePhase,takeSessionTime,timePhaseandtimePhaseAsyncare already imported on line 18 ofsrc/http/api.ts. Do not add another import. Both earlier tries (pulls #3783 and #3962) failed the check withTS2300: Duplicate identifier 'timePhaseAsync'. Runbun x tsc --noEmitbefore you push. TheGET …/pulls/:numberhandler (about line 3712) shows the pattern to copy.Done:
notePhase(ctx.request, "session", takeSessionTime(ctx.request)), so a 404 for an unknown repository still namessession.listwrapslistQuery+listPulls;merge(viatimePhaseAsync) wraps thepullDirOfcalls andpullMergeStates;labelswrapsvariantSiblingsandwithLabelsMany;renderwraps thejson(paged(…))call.test/api-pulls-timing.test.ts(copy the setup fromtest/api-pull-timing.test.ts) checks that the Server-Timing header names session, list, merge, labels and render for a repository with two open pulls, and that a 404 names session. Without the change this test fails. The JSON body is unchanged.bun x tsc --noEmitpasses.Files: src/http/api.ts (this one handler only, no import changes), test/api-pulls-timing.test.ts (new). Risk: small. Touch no other handler.
Replaces #3770.