ci(pr-fast): run heavy jobs only in the merge queue, not on every PR - #480
Merged
Merged
Conversation
The heavy jobs (sanity / clippy{,-no-default} / rustdoc / test-build /
tests / security / windows-lint) ran on BOTH `pull_request` and
`merge_group` — i.e. the full Rust suite executed twice per PR: once on
the branch in isolation, then again in the queue against current main.
Gate them with `&& github.event_name != 'pull_request'` so they run only
on `merge_group` (the queue) and `push` (main). The queue already
revalidates every PR against current main before merging, and the
contributor's local `lint-pre-push` gate runs the same suite before the
push — so the `pull_request` pass is a redundant third run. This halves
Rust-PR CI without losing safety.
The `required` aggregator already treats `skipped` as a pass, so a PR
goes green (heavy jobs skipped) and can enter the queue; on `merge_group`
the jobs run for real and gate the merge. Cheap checks (fmt / file-size /
drift / classify) stay on `pull_request` for fast author feedback.
Co-Authored-By: Claude Opus 4.8 <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.
Why
With the merge queue live, the heavy
pr-fast.ymljobs (sanity,clippy×2,rustdoc,test-build,tests,security,windows-lint) ran the full Rust suite twice per PR: once onpull_request(branch in isolation) and again onmerge_group(against current main). Thepull_requestpass is redundant — the queue revalidates against main before merging, and the contributor's locallint-pre-pushgate already ran the same suite before the push.What
Gate the 8 heavy jobs with
&& github.event_name != 'pull_request'so they run only onmerge_group(queue) andpush(main). Cheap checks (fmt/file-size/ drift /classify) stay onpull_requestfor fast author feedback.The
requiredaggregator already treatsskippedas a pass (case "$r" in success|skipped) ✅), so on a PR the heavy jobs skip →requiredis green → the PR enters the queue; onmerge_groupthey run for real and gate the merge.Effect: Rust-PR CI runs the heavy suite once instead of twice — no loss of safety (the queue is the authoritative validation against current main).