Repository navigation
Skip the pull request workflow for draft PRs - #9993
Merged
Merged
Conversation
Each PR run is 35 jobs and about 570 runner-minutes. Drafts now skip every job (the three root jobs carry the guard, the rest need them); marking a PR ready runs the full suite, and converting back to draft starts a skipped run that cancels the in-progress one through the concurrency group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ped need Review finding: a job-level `!cancelled()` passed the test while defeating the draft guard. The test now rejects always(), cancelled() and failure() in job-level conditions; the !cancelled() mutation on Lint fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 7, 2026 18:26
hua7450
approved these changes
Oct 8, 2026
5 tasks done
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
The PR workflow runs 35 jobs, about 570 runner-minutes per run, on every push to every open PR, drafts included. 36 of the 123 open PRs are drafts. Many PRs also get several pushes during review rounds before they are ready.
This PR makes draft PRs skip the workflow:
pull_requestnow liststypes: [opened, synchronize, reopened, ready_for_review, converted_to_draft]. Marking a PR ready for review starts a full run.ReleaseLock,ReleaseLockTests,check-changelog) carryif: github.event.pull_request.draft == false. Every other jobneedsone of them, directly or transitively, so the whole run skips for drafts. No job usesalways().cancel-in-progress: true), so it cancels any run still in progress.Branch protection is unaffected. Draft PRs can't merge, and a ready PR gets a full run.
Invariants (tested)
policyengine_us/tests/code_health/test_pr_workflow_skips_drafts.py:ready_for_reviewandconverted_to_draftare among the triggers.always(),cancelled(),failure()). The!cancelled()mutation on Lint fails the test.Both tests fail on main and pass here. The existing workflow tests also pass:
.github/tests/test_release_build.py(8),test_make_test_matches_ci.py(2) andtest_rest_python_groups.py(12).Readiness caveat (review finding)
On a draft,
gh pr checksexits 0 with every check skipped, andmergeablestays MERGEABLE. A readiness check that only reads those two can therefore pass on code that ran no CI. The same is true in the seconds aftergh pr ready, before the new run registers.Merge tooling should also require:
isDraft == false;Pull requestrun at the exact head that concludedsuccess, notskipped.The US + core hub's merge gate now requires both.
Live check
This PR is opened as a draft. A
pull_requestrun uses the workflow file from the PR's merge commit, so this PR's own CI should skip every job while it is a draft. Main is currently red (#9992 fixes it), so it will be marked ready after #9992 lands, and that should start the full suite.Impact
No model output change: only the CI workflow, a test and a changelog fragment change.
axiom: n/a
🤖 Generated with Claude Code