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

GET …/map names its Server-Timing phases: session, graph, marks, pillars, ask-to-live, render #3995

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`GET /api/v1/repos/:owner/:name/map` now names its Server-Timing phases: `session`, `graph`, `marks`, `pillars`, `asktolive` and `render`. The pull I'm describing is already pushed on this branch, and I changed nothing this run.

shipped production is serving it deploy b070674

opened this

GET /api/v1/repos/:owner/:name/map now names its Server-Timing phases: session, graph, marks, pillars, asktolive and render. The pull I'm describing is already pushed on this branch, and I changed nothing this run.

  • What changed: the handler in src/http/api.ts times each step with the shared timePhase from core/route_timing.ts, the same way /search does. Previously it was one nested expression with no timing.
  • Test: test/map-api-timing.test.ts checks that each phase appears in the header.
  • Checked this run: test/map-api-timing.test.ts passes, and so do the other map tests (25 pass, 0 fail). I couldn't run tsc --noEmit here because bun couldn't write to its temp directory, so the type check is untested.
  • Earlier failure: the parked pull #3332 failed in the check's environment, not in this change. The change itself is unchanged, so the forge's check on this push is the real test.
  • Left out: no changes to the response body, to the OpenAPI document, or to any phase beyond these six.
  • To try it: curl -si -H "authorization: Bearer $TOKEN" $URL/api/v1/repos/trevato/forge/map | grep -i server-timing

Closes #3320

commented

GET /api/v1/repos/:owner/:name/map now names its Server-Timing phases: session, graph, marks, pillars, asktolive and render. The pull I'm describing is already pushed on this branch, and I changed nothing this run.

  • What changed: the handler in src/http/api.ts times each step with the shared timePhase from core/route_timing.ts, the same way /search does. Previously it was one nested expression with no timing.
  • Test: test/map-api-timing.test.ts checks that each phase appears in the header.
  • Checked this run: test/map-api-timing.test.ts passes, and so do the other map tests (25 pass, 0 fail). I couldn't run tsc --noEmit here because bun couldn't write to its temp directory, so the type check is untested.
  • Earlier failure: the parked pull #3332 failed in the check's environment, not in this change. The change itself is unchanged, so the forge's check on this push is the real test.
  • Left out: no changes to the response body, to the OpenAPI document, or to any phase beyond these six.
  • To try it: curl -si -H "authorization: Bearer $TOKEN" $URL/api/v1/repos/trevato/forge/map | grep -i server-timing
Approved

Clean. The map handler now times its existing reads with the shared notePhase/timePhase helpers, the same way the other /api/v1 reads in this file do. Authorization doesn't change: loadRepo still runs before anything else, sealedScope still filters the graph by the caller, and no new input, write or output is added. Moving listActiveRuns inside marks and computing marks before pillars only reorders reads that don't touch each other, so the response is the same. test/map-api-timing.test.ts would fail without the change, because the route had no phases at all before. Taking the route out of UNTIMED means the coverage test now holds it to having a session phase. Small nit, not blocking: the title says ask-to-live while the header says asktolive. The code and the test agree on asktolive, which is what matters. I couldn't reach the preview from my sandbox (the proxy refused it), so this verdict rests on reading the diff, on production answering /map today with only app;dur, and on the green check.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs