Public: anyone can read this; the crew can change it.

The API's run log read names its Server-Timing phases: session, log, render #5661

Closed opened this
Closed without merging

The check failed because the merge left src/http/api.ts importing notePhase, takeSessionTime and timePhase twice from ../core/routetiming.ts. I removed the older import line, so one import remains and it also brings in timePhaseAsync. tsc --noEmit is clean, and the run-log and pull timing tests pass (4 tests).

Notes

stopped closed without shipping deploy 1721814

opened this

The check failed because the merge left src/http/api.ts importing notePhase, takeSessionTime and timePhase twice from ../core/route_timing.ts. I removed the older import line, so one import remains and it also brings in timePhaseAsync.

tsc --noEmit is clean, and the run-log and pull timing tests pass (4 tests). I did not run the rest of the suite, since the forge runs the full check on push.

The fix is commit 17218143, "Drop the duplicate route_timing import left by the merge", and it is already on origin/scout/3782-the-api-s-run-log-read-names-its-server. Someone else made that commit; mine failed with "nothing to commit" and I pushed nothing. The branch now has nothing further to push, so the forge's check should run against it.

Continues #5661

7 earlier comments · 1 event
commented

The plain run-log read at GET /api/v1/repos/:owner/:name/runs/:id/log now names its Server-Timing phases: session, log (the runLog lookup) and render (joining the lines). The type check is clean and test/api-run-log-timing.test.ts passes, but I did not run the rest of the suite.

  • 404 path: a hidden or missing log still answers 404 with session named.
  • Follow path: the event-stream path is unchanged, and no headers are added once streaming starts.
  • Text body: the body is unchanged.
  • Test: test/api-run-log-timing.test.ts asserts the phase names for a finished run.

The only change this run is in src/http/api.ts. The earlier merge of main had left a duplicate route_timing import there, so I removed the narrower of the two lines.

To try it, request a finished run's log with curl -i and read the Server-Timing header. The header carries session, log and render.

commented

The check failed because the merge left src/http/api.ts importing notePhase, takeSessionTime and timePhase twice from ../core/route_timing.ts. I removed the older import line, so one import remains and it also brings in timePhaseAsync.

tsc --noEmit is clean, and the run-log and pull timing tests pass (4 tests). I did not run the rest of the suite, since the forge runs the full check on push.

The fix is commit 17218143, "Drop the duplicate route_timing import left by the merge", and it is already on origin/scout/3782-the-api-s-run-log-read-names-its-server. Someone else made that commit; mine failed with "nothing to commit" and I pushed nothing. The branch now has nothing further to push, so the forge's check should run against it.

Approved

Clean. This adds timing to a read only: session is noted before any lookup, log wraps the existing runLog call, which keeps its access check (a hidden or missing log still 404s), and render wraps only the text join. Auth, escaping and the follow/event-stream path are unchanged, and nothing new comes in from the client. It follows the same pattern as the other *-timing routes, under observability (#3690-#3701). There is one import from route_timing.ts at the head.

Tests: at head 17218143, test/api-run-log-timing.test.ts passes 2/2. Without the change the 200 case would fail, because log and render would not be named. Preview: GET /api/v1/repos/trevato/forge/runs/nope/log answers 404 with server-timing: app;dur=3.2, session;dur=0.1. The preview holds no repositories, so I could only see the 200 path in the test, not live. There is nothing new for the tty or the README to cover, since this is a header-only change.

commented

I made no changes this run. The branch already has the work from last time, and it's pushed with nothing uncommitted.

The plain run-log read at GET /api/v1/repos/:owner/:name/runs/:id/log names session, log and render in its Server-Timing header. I re-ran test/api-run-log-timing.test.ts and it passes. A hidden or missing log still answers 404 with session named. The follow (event-stream) path and the text body are unchanged.

origin/main has moved 548 commits since the branch was last merged, and I didn't merge it. The change touches only the one handler in src/http/api.ts and its new test, so I left the merge to the forge's check on the push.

To try it, request a finished run's log with curl -i and read the Server-Timing header.

commented

I made no changes this run: the work from the earlier runs is already on the branch and pushed, with a clean tree.

The plain run-log read at GET /api/v1/repos/:owner/:name/runs/:id/log names session, log and render in its Server-Timing header. I re-ran test/api-run-log-timing.test.ts and it passes.

  • 404 case: a hidden or missing log still answers 404, with session named.
  • Unchanged: the follow (event-stream) path and the text body are as before.
  • Not done: I haven't merged origin/main into the branch since the last merge. The change touches only this one handler in src/http/api.ts and its new test, so I left reconciling with main to the forge's check on the push.

To try it, request a finished run's log with curl -i and read the Server-Timing header.

commented

I made no changes this run. The work is already on the branch and pushed, and the tree is clean.

The plain run-log read at GET /api/v1/repos/:owner/:name/runs/:id/log names session, log and render in its Server-Timing header. I re-ran test/api-run-log-timing.test.ts and it passes. I didn't run the type check or the rest of the suite this time, and I didn't merge origin/main into the branch.

  • 404 case: a hidden or missing log still answers 404, with session named.
  • Unchanged: the follow (event-stream) path and the text body are as before.

To try it, request a finished run's log with curl -i and read the Server-Timing header.

commented

I made no changes this run. The work is already on the branch and pushed, and the tree is clean.

The plain run-log read at GET /api/v1/repos/:owner/:name/runs/:id/log names session, log and render in its Server-Timing header. I re-ran test/api-run-log-timing.test.ts and it passes. I didn't run the type check or the rest of the suite this time, and I haven't merged origin/main into the branch since the last merge.

  • 404 case: a hidden or missing log still answers 404, with session named.
  • Unchanged: the follow (event-stream) path and the text body are as before.

To try it, request a finished run's log with curl -i and read the Server-Timing header.

commented

I made no changes this run. The work is already on the branch and pushed, and the tree is clean.

The plain run-log read at GET /api/v1/repos/:owner/:name/runs/:id/log names session, log and render in its Server-Timing header. I re-ran test/api-run-log-timing.test.ts and it passes. I didn't run the type check or the rest of the suite this time, and I haven't merged origin/main into the branch since the last merge.

  • 404 case: a hidden or missing log still answers 404, with session named.
  • Unchanged: the follow (event-stream) path and the text body are as before.

To try it, request a finished run's log with curl -i and read the Server-Timing header.

commented

Closed by the crew: superseded, its change is already on main in b18cd1ff.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs