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

A repository's commits list's Server-Timing names its phases: session, each read, render #4036

Merged opened this

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

Merged

The commits list now answers with a `Server-Timing` header naming `session`, `repo`, `log`, `refs` and `render`. The earlier check failure was in the environment, not the change. I merged the current `main` into this branch and re-pushed without touching the code.

shipped production is serving it deploy d5b2fe2

opened this

The commits list now answers with a Server-Timing header naming session, repo, log, refs and render. The earlier check failure was in the environment, not the change. I merged the current main into this branch and re-pushed without touching the code.

  • Change: commitsPage in src/web/pages/commits.ts uses notePhase, timePhase and timePhaseAsync from src/core/route_timing.ts, the same way boards-view.ts does. Each read is wrapped in place, so order and errors are unchanged, and nothing new is computed for the header. render covers page assembly, on both the empty and the populated path.
  • Test: test/commits-timing.test.ts requests the page and asserts each phase name appears with a duration. It would fail without the change. docs/CACHING.md notes the phases.
  • Unchanged: the body, status codes and caching.
  • Checked: bun test on the new test and on test/web-code.test.ts passes. I did not run the type check here: bun install could not write to the temp directory, so tsc was not available. I left the whole check to the forge.
  • Not done: the not-found path (loadRepo returns nothing) emits only session and repo, since it reads and renders nothing else.

To try it, run curl -sI <app>/<owner>/<repo>/commits and read the Server-Timing line.

🤖 Generated with Claude Code

Closes #3277

commented

The commits list now answers with a Server-Timing header naming session, repo, log, refs and render. The earlier check failure was in the environment, not the change. I merged the current main into this branch and re-pushed without touching the code.

  • Change: commitsPage in src/web/pages/commits.ts uses notePhase, timePhase and timePhaseAsync from src/core/route_timing.ts, the same way boards-view.ts does. Each read is wrapped in place, so order and errors are unchanged, and nothing new is computed for the header. render covers page assembly, on both the empty and the populated path.
  • Test: test/commits-timing.test.ts requests the page and asserts each phase name appears with a duration. It would fail without the change. docs/CACHING.md notes the phases.
  • Unchanged: the body, status codes and caching.
  • Checked: bun test on the new test and on test/web-code.test.ts passes. I did not run the type check here: bun install could not write to the temp directory, so tsc was not available. I left the whole check to the forge.
  • Not done: the not-found path (loadRepo returns nothing) emits only session and repo, since it reads and renders nothing else.

To try it, run curl -sI <app>/<owner>/<repo>/commits and read the Server-Timing line.

🤖 Generated with Claude Code

Approved

Approved. The commits list now names session, repo, log, refs and render in Server-Timing. Reads keep their order and errors, the body and status are unchanged, and the test asserts every phase with a duration. The preview shows the header on the not-found path (app, session, repo). I could not see the populated path there, because the repo I tried is not on the preview. No markup changed, so there is no design-system or JS-off impact. Two things I would do next: (1) docs/CACHING.md cites #3392 while this pull is #4036, so check that reference. (2) Add a short test that the not-found path emits session and repo and no log, so that behaviour is pinned.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs