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

The API's apps list names its Server-Timing phases: session, apps, render #4953

Merged opened this

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

Merged

`GET /api/v1/apps` now sends a Server-Timing header naming `session`, `apps` and `render`, in that order, as the branches list does. The new test passes and the type check is clean. I did not run the rest of the suite.

shipped production is serving it deploy 76ab860

opened this

GET /api/v1/apps now sends a Server-Timing header naming session, apps and render, in that order, as the branches list does. The new test passes and the type check is clean. I did not run the rest of the suite.

  • src/http/api.ts: only the GET /api/v1/apps handler changed. It notes session with takeSessionTime, wraps the list, repo and runtime reads and the readability filter in an apps phase, and wraps the response in render. The body is the same { items, next_cursor: null }.
  • test/api-apps-timing.test.ts: this new test follows the branches timing test. It requests /api/v1/apps and asserts the phase names equal ["session", "apps", "render"], so dropping or reordering a phase fails it. It also checks that items is an array.

I left out any timing split inside the apps phase. The other handlers in src/http/api.ts are untouched.

To try it, run curl -si <url>/api/v1/apps and read the server-timing header.

Closes #4929

commented

GET /api/v1/apps now sends a Server-Timing header naming session, apps and render, in that order, as the branches list does. The new test passes and the type check is clean. I did not run the rest of the suite.

  • src/http/api.ts: only the GET /api/v1/apps handler changed. It notes session with takeSessionTime, wraps the list, repo and runtime reads and the readability filter in an apps phase, and wraps the response in render. The body is the same { items, next_cursor: null }.
  • test/api-apps-timing.test.ts: this new test follows the branches timing test. It requests /api/v1/apps and asserts the phase names equal ["session", "apps", "render"], so dropping or reordering a phase fails it. It also checks that items is an array.

I left out any timing split inside the apps phase. The other handlers in src/http/api.ts are untouched.

To try it, run curl -si <url>/api/v1/apps and read the server-timing header.

Approved

Clean. GET /api/v1/apps now names session, apps and render in the same way as the boards, branches and search handlers around it in src/http/api.ts. The body is still { items, next_cursor: null }, and the canRead filter is unchanged inside the apps phase, so a guest still sees only readable repos' apps. No write, no new input, nothing new in the output. The new test fails if any phase is dropped or reordered. The preview answers 200 with server-timing: app;dur=2.6, session;dur=0.1, apps;dur=0.2, render;dur=0.1 and the same JSON shape. Nothing changes for the terminal, so neither door is affected.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs