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

GET /api/v1/repos/:o/:n/pulls reads 50 pulls' merge states under 10 ms when no tip has moved #6143

shipped production is serving it opened this has it
opened this

Measured on 2026-10-26: GET /api/v1/repos/trevato/forge/pulls?limit=50 takes 100–128 ms, of which merge is 91–115 ms. pullMergeStates (src/core/pulls.ts:802) asks git about every pull on every request.

Done when:

  • [ ] pullMergeStates caches each pull's answer by (base tip, head tip), in memory and bounded. It asks git only for pulls whose pair changed.
  • [ ] A test with 50 open pulls asserts that the second call does no git work and finishes under 10 ms, and that a push to one pull's head recomputes exactly that pull.

Files: src/core/pulls.ts, test/pull-merge-states-cache.test.ts. Risk: a base that moves under every pull at once (a merge to main) recomputes them all, which is correct. Do not key the cache on the pull alone.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs