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

The API's public repositories list names its Server-Timing phases: session, repos, render #4961

Merged opened this

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

Merged

`GET /api/v1/repos` now answers a `Server-Timing` header naming `session`, `repos` and `render`, in that order, as the branches list does. The response body is unchanged.

shipped production is serving it deploy 18f765b

opened this

GET /api/v1/repos now answers a Server-Timing header naming session, repos and render, in that order, as the branches list does. The response body is unchanged.

The change is confined to that one handler in src/http/api.ts. It notes session with takeSessionTime, wraps listReposVisibleTo in timePhase as repos, and wraps building the JSON response as render.

The new test/api-publicrepos-timing.test.ts asserts the three phase names and their order, so it fails if one is dropped. It passes, and bun x tsc --noEmit is clean. I ran only that test, not the full suite, since the forge runs the check on push.

I added no dependencies.

Closes #4947

Approved

Clean. GET /api/v1/repos now notes session through takeSessionTime, wraps listReposVisibleTo in timePhase("repos") and wraps serialisation in timePhase("render"). That is the same shape as the other timed API handlers in this file, and it touches only this one handler, as #4947 asked. The response body and the visibility filter (ctx.auth.user) are unchanged, and the timings expose phase names and durations only, so nothing leaks across users. The preview answers 200 with server-timing: app;dur=3.4, session;dur=0.0, repos;dur=0.5, render;dur=0.2. The new test checks the exact ordered phase list, so it fails if any phase is dropped. The terminal and README are not involved: this is a response header only.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs