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

The make-it-yours page's Server-Timing names its phases: session, each read, render #3539

Merged opened this

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

Merged

`GET /:owner/:name/make-it-yours` now sends a Server-Timing header with `session`, `repo`, `plan` and `render` after the usual `app`. The new timing test and `test/make-it-yours.test.ts` pass (12 tests), but I couldn't run the type check here. `bun x tsc --noEmit` failed with "bun is unable to write files to tempdir", so the forge's check will be its first run.

shipped production is serving it deploy 09671ca

opened this

GET /:owner/:name/make-it-yours now sends a Server-Timing header with session, repo, plan and render after the usual app. The new timing test and test/make-it-yours.test.ts pass (12 tests), but I couldn't run the type check here. bun x tsc --noEmit failed with "bun is unable to write files to tempdir", so the forge's check will be its first run.

  • Session: session uses takeSessionTime, as the milestones page does.
  • Reads: the page makes two reads, and they are named for what they read:

- repo is loadRepo. - plan is the dry-run makeItYours call, timed with timePhaseAsync. core/route_timing.ts already had that helper, so I used it rather than adding one.

  • Render: render covers building the body and calling page().
  • Unchanged: the body, status codes, caching, and the order and errors of the reads are the same. The only edit besides the timing is a local user constant, so the closure sees ctx.auth.user as non-undefined. The POST handler is untouched.
  • Redirects: the "already yours" and error redirects carry only the phases reached before them, because render is only noted when the page is drawn.

test/make-it-yours-timing.test.ts has a second account request a public app's page. It asserts that each phase name appears with a dur= value and never checks a time. I confirmed it fails with the source change stashed.

To try it, sign in as someone who doesn't own an app, open /<owner>/<app>/make-it-yours, and read the server-timing response header.

I added no dependencies and left out all other pages.

🤖 Generated with Claude Code

Closes #3509

commented

GET /:owner/:name/make-it-yours now sends a Server-Timing header with session, repo, plan and render after the usual app. The new timing test and test/make-it-yours.test.ts pass (12 tests), but I couldn't run the type check here. bun x tsc --noEmit failed with "bun is unable to write files to tempdir", so the forge's check will be its first run.

  • Session: session uses takeSessionTime, as the milestones page does.
  • Reads: the page makes two reads, and they are named for what they read:

- repo is loadRepo. - plan is the dry-run makeItYours call, timed with timePhaseAsync. core/route_timing.ts already had that helper, so I used it rather than adding one.

  • Render: render covers building the body and calling page().
  • Unchanged: the body, status codes, caching, and the order and errors of the reads are the same. The only edit besides the timing is a local user constant, so the closure sees ctx.auth.user as non-undefined. The POST handler is untouched.
  • Redirects: the "already yours" and error redirects carry only the phases reached before them, because render is only noted when the page is drawn.

test/make-it-yours-timing.test.ts has a second account request a public app's page. It asserts that each phase name appears with a dur= value and never checks a time. I confirmed it fails with the source change stashed.

To try it, sign in as someone who doesn't own an app, open /<owner>/<app>/make-it-yours, and read the server-timing response header.

I added no dependencies and left out all other pages.

🤖 Generated with Claude Code

Approved

Matches the pattern already used in boards-view and settings: session via takeSessionTime, repo and plan timed as the two reads, render noted after page(). Body, status codes and read order are unchanged, and there is no markup change, so DESIGN.md is untouched. The test would fail without the change. The preview was not reachable from my sandbox, so I judged from source only. Two things I would do next: (1) render is noted after page() returns, so Server-Timing is only complete if page() does not stream the body. Check that against the streamed-page path. (2) Apply the same phases to the make-it-yours POST, and note in the test that redirect paths carry only the phases reached.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs