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

The repository map's API names what holds each ready issue: hot_file with the file, run_cap, open_pull and the rest #6862

opened this

Merged 37d 22h ago, live in production

GET /api/v1/repos/:owner/:name/map now says what holds each ready issue. The type check and the map tests I ran pass: map-held, map-api-timing, map-seed-timing, map-cache and map. I did not run the whole suite, crew-held included; the forge's check does that on push.

Notes

opened this

GET /api/v1/repos/:owner/:name/map now says what holds each ready issue. The type check and the map tests I ran pass: map-held, map-api-timing, map-seed-timing, map-cache and map. I did not run the whole suite, crew-held included; the forge's check does that on push.

  • Held and startable: each ready entry carries held: null or { by: <HoldName>, detail }. The map also carries startable, the issue numbers no filter holds.
  • hot_file detail: it names the file and its open-pull count, for example src/hot.ts is in 3 open pulls. An admin's hold on a file says <path> is held by an admin.
  • Other holds: they get a fixed one-line reason.
  • How it's built: it reuses heldBy and hotFiles through a new mapHolds in src/crew/held.ts. It makes no git call. It runs inside the cached map build as a new held Server-Timing phase, so a cache hit pays nothing.
  • Privacy: the held list is built from the viewer's own graph, so a sealed issue the viewer may not see is never in ready and never named. The test checks that an anonymous reader's response has no sealed issue and no startable entry for it.
  • Tests: the new test/map-held.test.ts seeds one issue held by a hot file and one free, and checks held and startable. I changed test/map-api-timing.test.ts to expect the new held phase in the Server-Timing list. That test was out of date because of this change, not wrong.

Left out:

  • The direction issue is excluded from startable, as heldBy does, but still shows held: null in ready.
  • Hot-file counts live in memory, so a map snapshot can lag them by up to its 60-second cache.

To try it, fetch the map for any repo with a crew and look at ready[].held and startable.

Closes #6441

2 earlier comments
commented

GET /api/v1/repos/:owner/:name/map now says what holds each ready issue. The type check and the map tests I ran pass: map-held, map-api-timing, map-seed-timing, map-cache and map. I did not run the whole suite, crew-held included; the forge's check does that on push.

  • Held and startable: each ready entry carries held: null or { by: <HoldName>, detail }. The map also carries startable, the issue numbers no filter holds.
  • hot_file detail: it names the file and its open-pull count, for example src/hot.ts is in 3 open pulls. An admin's hold on a file says <path> is held by an admin.
  • Other holds: they get a fixed one-line reason.
  • How it's built: it reuses heldBy and hotFiles through a new mapHolds in src/crew/held.ts. It makes no git call. It runs inside the cached map build as a new held Server-Timing phase, so a cache hit pays nothing.
  • Privacy: the held list is built from the viewer's own graph, so a sealed issue the viewer may not see is never in ready and never named. The test checks that an anonymous reader's response has no sealed issue and no startable entry for it.
  • Tests: the new test/map-held.test.ts seeds one issue held by a hot file and one free, and checks held and startable. I changed test/map-api-timing.test.ts to expect the new held phase in the Server-Timing list. That test was out of date because of this change, not wrong.

Left out:

  • The direction issue is excluded from startable, as heldBy does, but still shows held: null in ready.
  • Hot-file counts live in memory, so a map snapshot can lag them by up to its 60-second cache.

To try it, fetch the map for any repo with a crew and look at ready[].held and startable.

commented

Both points from the review are fixed, and the change is pushed to the same branch. The type check passes and so do the tests for the map, crew-held, crew-hot-files, the MCP and the map timing. I did not run the full suite; the forge's check does that.

  • Sealed pulls (high): the holds are now built for the viewer's sealedScope.
    • Hot counts: hotFiles and pullCounts take an optional admit(pullNumber) filter, so a sealed pull is left out of the count for a guest. An admin still sees it.
    • open_pull: heldBy applies the same filter to the pulls that propose an issue, so a guest no longer sees open_pull from a pull they cannot read.
    • Who sees what: with the sealed scope everything is admitted. Otherwise a pull counts if it is not sealed or the viewer wrote it.
    • Cache: the cache key already includes the scope, so cached answers stay separate per viewer.
  • MCP (medium): one helper, mapHeldFor in src/crew/held.ts, now serves both the route and the MCP map tool. The MCP tool returns held and startable.
  • Tests: test/map-held.test.ts now seeds a sealed pull on src/hot.ts, and the new cases would fail without the fix. The guest's detail says ${HOT_PULLS} open pulls, an admin's says one more, and the MCP map tool returns hot_file and startable.
  • Not tested: the open_pull filter has no test of its own. Its guest case needs a real sealed pull that closes a public issue, which I did not build. The sealed-pull test covers the hot-file count.
  • Direction issue: as before, it stays out of startable but shows held: null.
commented

Both gaps are now covered by tests, and the branch is pushed. bun x tsc --noEmit and test/map-held.test.ts pass (5 tests). I did not run the full suite; the forge's check does that.

  • open_pull filter: a new case in test/map-held.test.ts opens a real pull that closes a public ready issue, then seals the pull row. The guest's map shows that issue with held: null. The admin's map shows held.by === "open_pull". I reverted the filter in heldBy and the test failed, then restored it.
  • Admin-pin detail: the same case seeds a file hold on src/pinned.ts and checks the detail reads src/pinned.ts is held by an admin. It also checks that by is hot_file for the admin.
  • Guest startable: the new docs/features/map-held.md says a guest's startable is what that viewer can see as free, not the crew's queue. The README is capped, so the note is not there. The same file says hot-file counts can lag a cached map by up to a minute.
Sign in to join this conversation.

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

Keyboard shortcuts

Docs