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

The API's commit check read names its Server-Timing phases: session, check, render #4934

Merged opened this

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

Merged

`GET /api/v1/repos/:owner/:name/commits/:oid/check` now answers a Server-Timing header naming `session`, `check` and `render`. The response body is unchanged.

shipped production is serving it deploy 1f09d72

opened this

GET /api/v1/repos/:owner/:name/commits/:oid/check now answers a Server-Timing header naming session, check and render. The response body is unchanged.

The new test/api-ccheck-timing.test.ts passes and fails if a phase is dropped. I did not run the full bun test. The type check could not run here, because tsc cannot find the bun type definitions.

  • Change: only this handler in src/http/api.ts changed. It notes session with takeSessionTime, wraps checkOfCommit in timePhaseAsync as check, and wraps the JSON response in timePhase as render.
  • Test: it follows test/api-branches-timing.test.ts. A well-formed oid with no check still answers 200 and shows all three phases in order. A missing repository answers 404 and shows only session, since it returns before reaching check.
  • Left out: I did not time loadRepo separately. It stays inside the session to check gap, as in the other handlers.

To try it, request the check URL for any commit and read the Server-Timing header.

🤖 Generated with Claude Code

Closes #4928

commented

GET /api/v1/repos/:owner/:name/commits/:oid/check now answers a Server-Timing header naming session, check and render. The response body is unchanged.

The new test/api-ccheck-timing.test.ts passes and fails if a phase is dropped. I did not run the full bun test. The type check could not run here, because tsc cannot find the bun type definitions.

  • Change: only this handler in src/http/api.ts changed. It notes session with takeSessionTime, wraps checkOfCommit in timePhaseAsync as check, and wraps the JSON response in timePhase as render.
  • Test: it follows test/api-branches-timing.test.ts. A well-formed oid with no check still answers 200 and shows all three phases in order. A missing repository answers 404 and shows only session, since it returns before reaching check.
  • Left out: I did not time loadRepo separately. It stays inside the session to check gap, as in the other handlers.

To try it, request the check URL for any commit and read the Server-Timing header.

🤖 Generated with Claude Code

Approved

Clean. The handler gets the same session / check / render wrapping as the other timed API reads (notePhase + takeSessionTime, timePhaseAsync around checkOfCommit, timePhase around json). The body, the auth path (ctx.auth.user passed through, loadRepo gating visibility) and cache-control: no-store are unchanged. No new input, output or write surface, and only this handler was touched, as the issue asked. The test checks both the 200 order (session, check, render) and the 404 short-circuit (session only), so it fails if any phase is dropped. On the preview, the 404 path answers server-timing: app;dur=2.6, session;dur=0.1. The preview has no public repository to hit the 200 path, so the test is what covers that one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs