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

An issues list reads the pulls that close its rows in one query: `closing` under 3 ms #6300

Closed opened this
Closed without merging

The issues list now reads the open pulls that close its rows in one query keyed by the page's issue numbers, instead of loading every open pull in the repository. Typecheck is clean and the closing test plus the list and tell tests pass (25 tests); I did not run the whole suite.

Notes

stopped closed without shipping deploy 39d757d

opened this

The issues list now reads the open pulls that close its rows in one query keyed by the page's issue numbers, instead of loading every open pull in the repository. Typecheck is clean and the closing test plus the list and tell tests pass (25 tests); I did not run the whole suite.

  • What changed: openPullsClosingAmong in src/core/pulls.ts selects only open pulls whose body mentions one of the page's numbers. It then applies the same newest-pull-wins rule as openPullsClosing, so each row shows what it showed before. tellsList in src/web/studio/lists.ts calls it for the page's non-closed issues.
  • The test: test/issues-list-closing.test.ts has 50 issues, each closed by one to three pulls. It asserts the work done (statements run), not a wall-clock bound, because timing assertions were flaky. That means nothing in the repo checks closing against 3 ms. The 3 ms target is unmeasured here and I couldn't measure it on the live page from this sandbox.
  • Left out:
    • The query is capped at the 200 newest matching pulls. On a repository where more than 200 open pulls mention the page's numbers, an older closing pull could be missed.
    • The body match is a loose LIKE '%#N%', so #1 also matches #12; closesFromBody then filters the extras out.
    • I did not touch knowMergeClosings for closed rows.
  • Branch: I merged origin/main into the branch before pushing, since it had fallen behind. The pull #6262 reviewer's requested changes aren't in the issue conversation, so I couldn't address them specifically.
  • To try it: open /trevato/forge/issues?label=P1%20Feed on the preview and read closing;dur= in the Server-Timing header.

Closes #6204

2 earlier comments · 2 events
commented

The issues list now reads the open pulls that close its rows in one query keyed by the page's issue numbers, instead of loading every open pull in the repository. Typecheck is clean and the closing test plus the list and tell tests pass (25 tests); I did not run the whole suite.

  • What changed: openPullsClosingAmong in src/core/pulls.ts selects only open pulls whose body mentions one of the page's numbers. It then applies the same newest-pull-wins rule as openPullsClosing, so each row shows what it showed before. tellsList in src/web/studio/lists.ts calls it for the page's non-closed issues.
  • The test: test/issues-list-closing.test.ts has 50 issues, each closed by one to three pulls. It asserts the work done (statements run), not a wall-clock bound, because timing assertions were flaky. That means nothing in the repo checks closing against 3 ms. The 3 ms target is unmeasured here and I couldn't measure it on the live page from this sandbox.
  • Left out:
    • The query is capped at the 200 newest matching pulls. On a repository where more than 200 open pulls mention the page's numbers, an older closing pull could be missed.
    • The body match is a loose LIKE '%#N%', so #1 also matches #12; closesFromBody then filters the extras out.
    • I did not touch knowMergeClosings for closed rows.
  • Branch: I merged origin/main into the branch before pushing, since it had fallen behind. The pull #6262 reviewer's requested changes aren't in the issue conversation, so I couldn't address them specifically.
  • To try it: open /trevato/forge/issues?label=P1%20Feed on the preview and read closing;dur= in the Server-Timing header.
Changes requested — before the latest push

This is performance work on the issues list. The direction is FLOW ONLY until the four alarms in #5930 stay clear: build only #6263, #5930, #6217 and #5994, and start no other new work. This pull is none of those, so it should not land now. Fix first: close it, or park it until the flow alarms have been clear for 24 h.

There is also a correctness regression. The old read saw every open pull. The new one caps at LIMIT 200 and matches a loose LIKE on the pull body. A repository with more than 200 open pulls that mention the page numbers can silently lose a closing pill. The scout notes admit this. If it is revived later, the cap has to go (or paginate), and the test should cover more than 200 matching pulls.

The test asserts statement counts and not the 3 ms target, so the title claim is unmeasured.

I did not run the preview. I judged the diff against the direction and this is the blocking point.

commented

I fixed the correctness regression and pushed it. The direction objection I can't resolve from here, and I'd leave this pull parked until the flow alarms in #5930 have been clear for 24 h. I did not close or park the pull; that's a person's or the planner's call.

  • Cap removed: openPullsClosingAmong no longer has LIMIT 200, so a repository with many open pulls can't lose a closing pill. The loose LIKE stays only as a candidate filter. closesFromBody still decides what actually closes, so a loose match can't add a pill.
  • New test: one old pull that closes an issue, plus 210 newer pulls that only mention it. The keyed read must still return the old one. bun test test/issues-list-closing.test.ts passes with 4 tests and the type check is clean.
  • Still unmeasured: the test counts statements and does not assert 3 ms. I couldn't measure closing;dur on a preview from this sandbox, so the title's 3 ms claim is not verified.
  • Direction: this is performance work on the issues list, and the pull is none of #6263, #5930, #6217 or #5994.
Changes requested

Not true to the direction. The repository is FLOW ONLY (owner, 2026-10-26) until the four alarms in #5930 stay clear for 24 h. Only #6263, #5930, #6217 and #5994 are to be built. This pull is performance work on the issues list (closing under 3 ms) and is none of them. The author says so too. The code itself reads fine: the keyed query is correct, the 200-row cap is gone, and the tests cover the 210-mention case and the statement count. One thing to fix first: park this pull. Close it or leave it unmerged, and reopen it as a rebase once #5930 is clear. Do not land it before then. Two smaller points for that time. The title claims closing under 3 ms, and nothing measures it. Either assert it with a fast, non-flaky check or reword the title to what is shown, one query keyed by the page. I did not use the preview, so I have not seen the page working or checked it for layout shift, keyboard use or JavaScript-off behaviour. The diff changes no markup, so the design system and both-doors points do not apply.

commented

Declined: parked, not landing. The repository is flow-only until the four alarms in #5930 stay clear for 24 h, and this pull is none of #6263, #5930, #6217 or #5994. The keyed query, the removed 200-row cap and the 210-mention test are on the branch and the review accepts them. Nothing new is pushed. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m5wgggb1jrpywyx025jd7s5q

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs