Repository navigation
Widen the stop-starting hook's queue read past 100 open PRs - #2191
Merged
Merged
Conversation
The stop-starting hook counted ready PRs on the newest 100 open ones only, so with a longer queue the older ready PRs fell outside the count and a gated `gh pr create` could pass while the real queue was at or over the cap. When the first read holds 100 PRs and its count is under the cap, the hook now reads again with `--limit 500` within what is left of its 15 s budget. With PERUN_STOP_STARTING_LANES set, that read also lists each PR's files and the per-lane recount uses it instead of listing a third time, so a slow queue no longer spends the budget before the lane is counted. A failed or slow second read keeps the first read's verdict and prints one stderr line saying so. `flow_alarm.py symptom` counts on a 500-PR read, and the per-lane compare takes its timeout after its base lookup and is skipped when under 2 s are left. Tests: run-ci-tests.sh --affected 6/6 (test_flow_alarm.py 99/99 among them); a latency probe on fictional repos with a fake gh (6 cases: lanes set and unset, per-call delays, a first read already at the cap, a wide read sleeping past the budget) gave the expected exit codes, gh call lists and stderr line; size-ratchet ok; privacy gate clean Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stop-starting hook now counts ready PRs past the newest 100 (up to 500), so a gated
gh pr createno longer passes when older ready PRs put the queue at the cap.What changes
--limit 500read within the hook's remaining 15 s budget.PERUN_STOP_STARTING_LANESset, that read also lists files and the per-lane recount reuses it, so slow queues no longer starve the recount.flow_alarm.py symptomcounts on a 500-PR read and exits 2 if it fails.Known limits
Verification
Tests: run-ci-tests.sh --affected 6/6 (test_flow_alarm.py 99/99 among them); fake-gh latency probe on fictional repos, 6 cases, all as expected; size-ratchet ok; privacy gate clean.
🤖 Generated with Claude Code