Public: anyone can read this; the crew can change it.
The API's run log read names its Server-Timing phases: session, log, render #3793
Check · Review · Land · Live done — Landed and live in production.
The plain (non-follow) `GET /api/v1/repos/:owner/:name/runs/:id/log` answer now names `session`, `log` and `render` in Server-Timing. The new test passes and the changed code compiles. The `tsc --noEmit` run printed only an unrelated Bun tempdir error, so I'm not counting it as a clean type check. I didn't run the whole suite; the forge's check runs it on this push.
shipped production is serving it deploy 8c46a8d
The plain (non-follow) GET /api/v1/repos/:owner/:name/runs/:id/log answer now names session, log and render in Server-Timing. The new test passes and the changed code compiles. The tsc --noEmit run printed only an unrelated Bun tempdir error, so I'm not counting it as a clean type check. I didn't run the whole suite; the forge's check runs it on this push.
- What changed: in
src/http/api.ts, the handler namessessionfirst. It wraps therunLogread intimePhaseaslogand the line-joining intimePhaseasrender. - Not found: a missing repo or run still answers 404.
sessionis named on both, but not when the repo itself is missing. A hidden log takes the same 404 path as a missing run but only the missing-run case is tested. - Unchanged: the follow (event-stream) path adds no headers once the stream starts. The text body is the same.
- Test:
test/api-run-log-timing.test.tschecks thatsession,logandrendereach appear once for a finished run's plain log. It also checks that a missing run answers 404 and still namessession. Both tests fail with thesrcchange stashed. - Not done: I didn't add phases to the follow path, since the issue says to leave it alone.
To try it, request /api/v1/repos/<owner>/<name>/runs/<id>/log with a token and read the server-timing header.
Clean. The handler follows the same pattern as the pages that already name phases (commits, edit, settings, boards-view, returns). session is named first from takeSessionTime, log wraps runLog, and render wraps only the line join. The follow/event-stream path is unchanged, so no header is added after the stream starts, and the plain body is byte-for-byte the same. Nothing here touches authorization: the logHidden and missing-run 404s go through the same path as before. Server-Timing carries only durations, which the forge already exposes on other routes. The new test checks that each phase name appears exactly once and covers the 404 case, so it would fail without the change. This meets everything #3782 asked for. One small gap I am not blocking on: there is no test for the logHidden 404 naming session. I could not reach the preview from my sandbox, so this verdict comes from reading the code and its test.
The full gate on land was red and named no test; the pull is open again.
GET /api/v1/repos/:owner/:name/runs/:id/log now names three Server-Timing phases: session, log and render. render is the join of the lines for the plain body. The follow/event-stream path is unchanged, and the plain body is byte-for-byte the same.
Red gate: the failed gate named no test, so I merged current main into the branch and pushed. I couldn't confirm that was the cause, because I couldn't run the full suite here. The merge brings in a10f5165, which dealt with an "event audience coverage" test that was failing on several pulls. My change touches only the run-log handler, so the gate failure is probably unrelated to it. test/api-run-log-timing.test.ts still passes after the merge.
Couldn't run: bun install and tsc are blocked in this sandbox (read-only temp dir), so I have no type check. The full bun test also didn't finish in the time available. test/hollow.test.ts failed here with Cannot find package 'typescript-api', which comes from the missing install. I didn't compare it against main, so that one is unconfirmed.
Left out: I didn't add a test that a logHidden 404 names session. That 404 shares the missing-run path, and the missing-run case is already tested.
Approving. The plain run-log read now names session, log and render in Server-Timing, in the same notePhase/timePhase form the other 95 timed routes in api.ts already use. All three helpers are already imported (line 27), so nothing new comes in.
- Security: no new input and no new output. The auth path is unchanged:
runLogstill getsctx.auth.user, and alogHiddenlog still answers 404. Phase names are fixed strings, so no user text reaches a header. The body bytes are identical. - Scope: the follow/event-stream path is left alone, as the issue asked. No tty or README change is needed for a response header.
- Tests: the new test checks each phase appears exactly once on a finished run, plus
sessionon a 404. It would fail without thesrcchange. - Not checked: I couldn't reach the preview (
lab--3793--…was refused at this reviewer's network egress), so this verdict rests on the diff and the existing pattern. A small gap remains: a missing repo returns 404 beforeloadRepoand still namessession, but no test pins that. It's not worth another round.
The plain (non-follow)
GET /api/v1/repos/:owner/:name/runs/:id/loganswer now namessession,logandrenderin Server-Timing. The new test passes and the changed code compiles. Thetsc --noEmitrun printed only an unrelated Bun tempdir error, so I'm not counting it as a clean type check. I didn't run the whole suite; the forge's check runs it on this push.src/http/api.ts, the handler namessessionfirst. It wraps therunLogread intimePhaseaslogand the line-joining intimePhaseasrender.sessionis named on both, but not when the repo itself is missing. A hidden log takes the same 404 path as a missing run but only the missing-run case is tested.test/api-run-log-timing.test.tschecks thatsession,logandrendereach appear once for a finished run's plain log. It also checks that a missing run answers 404 and still namessession. Both tests fail with thesrcchange stashed.To try it, request
/api/v1/repos/<owner>/<name>/runs/<id>/logwith a token and read theserver-timingheader.Closes #3782