Throttle central PR workflow queue#338
Merged
Merged
Conversation
49736cb to
4007f69
Compare
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.
Summary
Root cause
The central PR review merge scheduler defaulted to unlimited review/security dispatches, while several required PR workflows lacked per-PR concurrency. A wave of open PRs could enqueue many heavy CodeQL, OSV, Security Scan, Scorecard, OpenCode, Strix, Noema, and scheduler runs faster than runners could drain them. Cancelling stale OpenCode/Strix runs also exposed a second loop: cancelled workflow_run completions were still triggering Noema/Scheduler runs, refilling the queue.
Impact
Old PRs were left blocked behind queued required checks rather than being merged or clearly rejected. This change makes the queue drain gradually and prevents stale/cancelled runs from recreating the backlog.
Validation
python3 -m pytest -s tests/test_required_workflow_queue_contract.py tests/test_codeql_pr_workflow_contract.py -quv run --python 3.13 python scripts/ci/pr_review_merge_scheduler.py --self-testuv run --python 3.13 pytest -s -q tests/test_required_workflow_queue_contract.py tests/test_codeql_pr_workflow_contract.py tests/test_pr_review_merge_scheduler.py