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

An issues list finds the open pulls that close its rows from their numbers and bodies alone, not 200 whole pulls #6338

Parked opened this
Closed without merging

The issues list now finds its closing pulls from numbers and bodies, and builds a Pull only for the ones that close a row on the page. I haven't measured closing;dur= before or after. The sandbox can't reach the preview, so that number still has to be pasted from the preview's issues list once it deploys.

Notes

stopped parked by the crew deploy abe4cd6

opened this

The issues list now finds its closing pulls from numbers and bodies, and builds a Pull only for the ones that close a row on the page. I haven't measured closing;dur= before or after. The sandbox can't reach the preview, so that number still has to be pasted from the preview's issues list once it deploys.

  • openPullsClosing (src/core/pulls.ts) takes an optional list of issue numbers. It reads number, body of the repository's open pulls in one SELECT, newest first, up to 200 as before. For each pull whose body closes a wanted number it calls getPull. The first pull to close a number still wins.
  • Page callers: src/web/studio/lists.ts passes the fetched rows' numbers. An empty page returns early without reading anything.
  • Other callers (now.ts, tell.ts, run.ts, milestones.ts, crew/direct.ts) pass no numbers and get the old shape, so they are unchanged.
  • Test hook: the module exports pullsHydrated, a counter the function increments for each pull it builds. This is the "hook the module exports for tests" the issue allows.
  • New test test/pulls-closing.test.ts:
    • It creates 150 open pulls, 3 of which close issues on a page of 50.
    • It asserts that the map holds exactly those 3 pulls and that 3 were hydrated.
    • It asserts that only wanted numbers are looked for, that an empty list returns nothing, and that no list gives the old behaviour.
    • On main it fails, because the counter doesn't exist there.
  • Checks run: the new test, issues-words, issues-list-timing, closed-issues-list-timing, pulls, edit-words and mcp-pulls pass. bun x tsc --noEmit is clean. I didn't run bun scripts/design-lint.ts because nothing under src/web/ that it checks was touched beyond one argument in lists.ts.

To try it, open /trevato/forge/issues?label=P1%20Feed on the preview and read closing;dur= in the Server-Timing header.

Closes #6324

commented

The issues list now finds its closing pulls from numbers and bodies, and builds a Pull only for the ones that close a row on the page. I haven't measured closing;dur= before or after. The sandbox can't reach the preview, so that number still has to be pasted from the preview's issues list once it deploys.

  • openPullsClosing (src/core/pulls.ts) takes an optional list of issue numbers. It reads number, body of the repository's open pulls in one SELECT, newest first, up to 200 as before. For each pull whose body closes a wanted number it calls getPull. The first pull to close a number still wins.
  • Page callers: src/web/studio/lists.ts passes the fetched rows' numbers. An empty page returns early without reading anything.
  • Other callers (now.ts, tell.ts, run.ts, milestones.ts, crew/direct.ts) pass no numbers and get the old shape, so they are unchanged.
  • Test hook: the module exports pullsHydrated, a counter the function increments for each pull it builds. This is the "hook the module exports for tests" the issue allows.
  • New test test/pulls-closing.test.ts:
    • It creates 150 open pulls, 3 of which close issues on a page of 50.
    • It asserts that the map holds exactly those 3 pulls and that 3 were hydrated.
    • It asserts that only wanted numbers are looked for, that an empty list returns nothing, and that no list gives the old behaviour.
    • On main it fails, because the counter doesn't exist there.
  • Checks run: the new test, issues-words, issues-list-timing, closed-issues-list-timing, pulls, edit-words and mcp-pulls pass. bun x tsc --noEmit is clean. I didn't run bun scripts/design-lint.ts because nothing under src/web/ that it checks was touched beyond one argument in lists.ts.

To try it, open /trevato/forge/issues?label=P1%20Feed on the preview and read closing;dur= in the Server-Timing header.

commented

Parked by the crew: the check failed ("a plan of 2,000 closed and 300 open issues, 3,000 pulls and 1,500 runs reads in under 50 ms with the same limbs") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs