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

A milestone's limb preview page's Server-Timing names its phases: session, each read, render #3540

Merged opened this

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

Merged

The limb preview page (`GET /:owner/:name/milestones/:number/limb`) now sends a Server-Timing header naming its phases. I couldn't run the type check here: `bun install` and `bun x tsc --noEmit` both fail with "unable to write files to tempdir" in this sandbox, so the forge's check will be its first run.

shipped production is serving it deploy 8d74cf9

opened this

The limb preview page (GET /:owner/:name/milestones/:number/limb) now sends a Server-Timing header naming its phases. I couldn't run the type check here: bun install and bun x tsc --noEmit both fail with "unable to write files to tempdir" in this sandbox, so the forge's check will be its first run.

  • Phases: session, repo (loading the repository), plan (the previewLimb read), pillars and render.
  • How: the change is in src/web/pages/limb.ts, using notePhase/timePhase the way milestones.ts does. Each read keeps its order and its errors, and nothing new is computed for the header.
  • pillars: it is named only on action=resume, because that is the only action that reads pillars.
  • Unchanged: the body, status codes and caching.
  • Test: test/limb-timing.test.ts requests the page with defer and resume. It asserts that app, session, repo, plan, render and pillars each appear with a duration, and that pillars is absent on defer. It asserts names and the dur= format, never a time.
  • Checks run: the new test passes with the change and fails without it, and test/limbs.test.ts still passes.
  • Left out: action=replan is handled in limb_replan.ts, which the issue told me not to touch. Its preview still carries only the session phase, so it needs its own issue if it should name its reads.

To try it, sign in, open /<owner>/<repo>/milestones/<n>/limb?action=defer and read the Server-Timing response header.

Closes #3510

commented

The limb preview page (GET /:owner/:name/milestones/:number/limb) now sends a Server-Timing header naming its phases. I couldn't run the type check here: bun install and bun x tsc --noEmit both fail with "unable to write files to tempdir" in this sandbox, so the forge's check will be its first run.

  • Phases: session, repo (loading the repository), plan (the previewLimb read), pillars and render.
  • How: the change is in src/web/pages/limb.ts, using notePhase/timePhase the way milestones.ts does. Each read keeps its order and its errors, and nothing new is computed for the header.
  • pillars: it is named only on action=resume, because that is the only action that reads pillars.
  • Unchanged: the body, status codes and caching.
  • Test: test/limb-timing.test.ts requests the page with defer and resume. It asserts that app, session, repo, plan, render and pillars each appear with a duration, and that pillars is absent on defer. It asserts names and the dur= format, never a time.
  • Checks run: the new test passes with the change and fails without it, and test/limbs.test.ts still passes.
  • Left out: action=replan is handled in limb_replan.ts, which the issue told me not to touch. Its preview still carries only the session phase, so it needs its own issue if it should name its reads.

To try it, sign in, open /<owner>/<repo>/milestones/<n>/limb?action=defer and read the Server-Timing response header.

Approved

Server-Timing only: no markup, CSS or JS changes, so docs/DESIGN.md is untouched. The pattern matches milestones.ts, the early returns (not found, sign-in) still carry session and repo, and the test would fail without the change (names, dur format, pillars only on resume). I could not reach the preview from my sandbox, so I judged from the source and the test. Next: (1) wrap the long pillars line to the repo's width; (2) open an issue for action=replan in limb_replan.ts, which still names only session.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs