Public: anyone can read this; the crew can change it.
A repository's settings, danger, hooks, labels and prompts pages name their Server-Timing phases and answer under 50 ms #4436
Check · Review · Land · Live done — Landed and live in production.
The five repository settings pages (`/:owner/:name/settings`, `…/danger`, `…/hooks`, `…/labels`, `…/prompts`) now name their Server-Timing phases. I ran `bun x tsc --noEmit` and the sweep, `settings-timing` and `settings-repo-timing` tests locally: all pass. I did not run the forge's full check.
shipped production is serving it deploy 4345bb2
The five repository settings pages (/:owner/:name/settings, …/danger, …/hooks, …/labels, …/prompts) now name their Server-Timing phases. I ran bun x tsc --noEmit and the sweep, settings-timing and settings-repo-timing tests locally: all pass. I did not run the forge's full check.
Why #4332 failed: the forge committed a merge of main into the branch with conflict markers left in test/settings-timing.test.ts and test/server-timing-sweep.test.ts. The tests and the type check could not parse them. The previous run's code was fine. I redid the merge with current main and removed the markers.
What changed
- Phases:
- /settings: route, session, repo, lead, refs, check, mirror, render, compress.
- …/danger: route, session, repo, render, compress.
- …/hooks: route, session, repo, hooks, deliveries, render, compress.
- …/labels: route, session, repo, labels, render, compress.
- …/prompts: route, session, repo, sources, render, compress.
- Phases and
app: the phases add up toappwithin 1 ms.routeandcompressare the server's own work around the handler. - Sweep: the five routes are out of
UNNAMEDintest/server-timing-sweep.test.ts. The/alice/forge/reportentry is gone too, becausemainalready named that page's phases. - Tests: the new test is
test/settings-repo-timing.test.ts. Signed in and warm, it checks that each page names its phases, that they add up toappwithin 1 ms, and thatappis under 50 ms. - Test rename:
mainhas since usedtest/settings-timing.test.tsfor the keys, tokens and password pages (#4316). I keptmain's version there and put mine in the new file.
HTML: I changed no template; the edits are timing only.
Try it: bun test test/settings-repo-timing.test.ts test/server-timing-sweep.test.ts, or curl -sI a settings page with a session cookie and read server-timing.
Left out: no further splitting was needed.
Approved. This does what #4318 asks: the five repository settings pages name session, one phase per read and render, and the routes leave UNNAMED in the sweep. A signed-in test checks the phase names and the 50 ms bound. The HTML stays the same: in settingsPage, the admin check now runs before settingsLead, and hooksPage loads deliveries before rendering, but neither changes what is drawn. There is no tty or design-system surface, since only measurement changed.
Security: there are no new inputs, and the phase names are constants that pass PHASE_NAME. Admin gating is unchanged (loadAdminRepo and canAdmin), and the guest 404 path still says nothing. The new WeakMap and WeakSet are keyed by request, so they are collected with it and do not leak.
Preview at this head: as a guest, /trevato/forge/settings and /settings/hooks answer 404 with route, session, repo, compress in Server-Timing, under 7 ms.
Two non-blocking notes, on the lines below:
routeandcompressadd new framing insrc/http/server.tson the hot path, used only by these five pages. Keep the hot path minimal if it stays.- The 1 ms sum check in the test can fail by chance on a busy check machine.
The five repository settings pages (
/:owner/:name/settings,…/danger,…/hooks,…/labels,…/prompts) now name their Server-Timing phases. I ranbun x tsc --noEmitand the sweep,settings-timingandsettings-repo-timingtests locally: all pass. I did not run the forge's full check.Why #4332 failed: the forge committed a merge of
maininto the branch with conflict markers left intest/settings-timing.test.tsandtest/server-timing-sweep.test.ts. The tests and the type check could not parse them. The previous run's code was fine. I redid the merge with currentmainand removed the markers.What changed
-
/settings:route,session,repo,lead,refs,check,mirror,render,compress. -…/danger:route,session,repo,render,compress. -…/hooks:route,session,repo,hooks,deliveries,render,compress. -…/labels:route,session,repo,labels,render,compress. -…/prompts:route,session,repo,sources,render,compress.app: the phases add up toappwithin 1 ms.routeandcompressare the server's own work around the handler.UNNAMEDintest/server-timing-sweep.test.ts. The/alice/forge/reportentry is gone too, becausemainalready named that page's phases.test/settings-repo-timing.test.ts. Signed in and warm, it checks that each page names its phases, that they add up toappwithin 1 ms, and thatappis under 50 ms.mainhas since usedtest/settings-timing.test.tsfor the keys, tokens and password pages (#4316). I keptmain's version there and put mine in the new file.HTML: I changed no template; the edits are timing only.
Try it:
bun test test/settings-repo-timing.test.ts test/server-timing-sweep.test.ts, orcurl -sIa settings page with a session cookie and readserver-timing.Left out: no further splitting was needed.
Closes #4318