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

The API's issue list names its Server-Timing phases: session, list, labels, render #4014

opened this

Merged 42d 18h ago, live in production

The API's issue list (GET /api/v1/repos/:owner/:name/issues) now names session, list, labels and render in its Server-Timing header. tsc and gate.ts are clean. The new timing test and the existing test/api tests pass locally.

Notes

opened this

The API's issue list (GET /api/v1/repos/:owner/:name/issues) now names session, list, labels and render in its Server-Timing header. tsc and gate.ts are clean. The new timing test and the existing test/api* tests pass locally. I did not run the whole check. I don't know why the first pull's check failed, since I couldn't see its log; this push runs it again.

  • Handler: session is noted from the session time already taken. list times listIssues with sealedScope. labels times withLabelsMany. render times paging and the JSON. The body and paging are unchanged, and no other handler in src/http/api.ts is touched.
  • 404: an unknown repository still names session.
  • Test: test/api-issues-timing.test.ts asserts that each of the four phases appears once for a repository with issues, and that the 404 names session. The test file is new, and the phase assertions would fail without the handler change.
  • Merge from main: main had moved on and already imports notePhase, takeSessionTime and timePhase in api.ts. After merging it, my own import duplicated those names and broke tsc, so I removed it. This duplicate is my best guess at why the earlier check failed, but I couldn't confirm it.

I left out the other handlers in api.ts; the issue said to touch only this one.

To try it, call the issue list with a bearer token and read the server-timing header.

🤖 Generated with Claude Code

Closes #3771

commented

The API's issue list (GET /api/v1/repos/:owner/:name/issues) now names session, list, labels and render in its Server-Timing header. tsc and gate.ts are clean. The new timing test and the existing test/api* tests pass locally. I did not run the whole check. I don't know why the first pull's check failed, since I couldn't see its log; this push runs it again.

  • Handler: session is noted from the session time already taken. list times listIssues with sealedScope. labels times withLabelsMany. render times paging and the JSON. The body and paging are unchanged, and no other handler in src/http/api.ts is touched.
  • 404: an unknown repository still names session.
  • Test: test/api-issues-timing.test.ts asserts that each of the four phases appears once for a repository with issues, and that the 404 names session. The test file is new, and the phase assertions would fail without the handler change.
  • Merge from main: main had moved on and already imports notePhase, takeSessionTime and timePhase in api.ts. After merging it, my own import duplicated those names and broke tsc, so I removed it. This duplicate is my best guess at why the earlier check failed, but I couldn't confirm it.

I left out the other handlers in api.ts; the issue said to touch only this one.

To try it, call the issue list with a bearer token and read the server-timing header.

🤖 Generated with Claude Code

commented

I merged main into this branch and pushed it. The merge conflicted only in src/http/api.ts, in the GET /issues handler.

  • Resolution: this pull wraps the list work in timePhase/notePhase, so the response now reports server timing for the issue list. main added ?fields=brief, which trims each item with briefIssue. The merged handler does both: the labels and render phases are timed, and brief is applied inside render. The fields check from main still returns 422 for any other value.
  • Checks: tsc --noEmit is clean and test/api-issues-timing.test.ts passes, along with the tests that exercise fields=brief (15 tests in total).
  • Not run: the full local bun test didn't finish in time, so the forge's check on this push is the first full run.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs