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

The API's flow read names its Server-Timing phases: session, flow, render #4919

Merged opened this

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

Merged

`GET /api/v1/repos/:owner/:name/flow` now answers a `Server-Timing` header naming `session`, `flow` and `render`, in that order. The type check is clean. The two timing tests pass, but I didn't run the full suite.

shipped production is serving it deploy ef63cd6

opened this

GET /api/v1/repos/:owner/:name/flow now answers a Server-Timing header naming session, flow and render, in that order. The type check is clean. The two timing tests pass, but I didn't run the full suite.

  • Handler: I followed the branches handler. The session time is noted first, readFlow runs inside a flow phase, and the JSON answer is built inside render. The body is unchanged, and only this handler in src/http/api.ts was touched.
  • Missing repository: it still returns 404, and the header names only session.
  • Test: test/api-flow-timing.test.ts asserts the exact phase list, so dropping or renaming a phase fails it. It also asserts the 404 case.

To try it, curl -i the flow path of any repo and look at Server-Timing.

Closes #4897

Approved

Clean. The handler follows the existing pattern exactly (session noted first, readFlow inside flow, json inside render), touches only the flow handler as #4897 asked, and leaves the body and the auth path (loadRepo + sealedScope) unchanged. Phase names are fixed strings, so nothing the client sends reaches the header. I ran test/api-flow-timing.test.ts at b52e94f: 2 pass, and both fail against the base api.ts, so the test catches a dropped phase. On the preview, a 404 flow read answers server-timing: app;dur=…, session;dur=…, which matches the second test. The preview has no visible repo to read the 200 path against, so the test covers that case. This is an API-only header with nothing to add to the page, tty or README. (The diff against current main also shows src/core/releases.json, but only because the base is older; the pull does not touch it.)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs