fix(ci): stop Mergify label events from cancelling required PR Gate runs - #11164
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents unrelated Mergify label events from cancelling required PR Gate runs.
Changes:
- Isolates unrelated label events into a separate concurrency group.
- Skips gate jobs and uses an alternate check name for those events.
- Preserves
A-releaselabel behavior.
conradoplg
approved these changes
Jul 31, 2026
Contributor
Merge Queue Status
This pull request spent 57 seconds in the queue, including 12 seconds running CI. Required conditions to merge
|
This was referenced Aug 5, 2026
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.
Motivation
Mergify merge-queue requeues currently fail systematically. On every requeue, Mergify flips labels on the source PR (
queuedadded, then the staledequeuedlabel removed ~40 s later).pr-gate.ymltriggers onlabeled/unlabeledand uses a single concurrency group withcancel-in-progress: true, so the second label event cancels the first PR Gate run mid-flight. The cancelled run'spr-gate-resultaggregator still executes (if: always()) and posts a failure check on the PR head. Mergify's stay-in-queue conditioncheck-success=pr-gate-resultthen dequeues the PR within ~2 minutes, before the queue draft's CI (which is green) can complete.Observed on #11146: queue attempts on 2026-07-31 at 14:42 and 18:12 UTC were both dequeued "with no time running CI". The
pr-gate-resultcheck-run history on head2c187ad6shows failures at 14:43:28, 14:45:41, 18:14:19, and 18:15:56 — each seconds after aqueued/dequeuedlabel event — recovering to success once the label churn settles. The first queue attempt (2026-07-30) survived because no staledequeuedlabel existed yet, so only one label event fired.tests-unit.ymlalready guards against this exact hazard ("Unrelated label events use a separate group so they cannot cancel the required unit test run").lint.ymlandtest-crates.ymluse the defaultpull_requesttypes and are not exposed.Solution
Mirror the
tests-unit.ymlpattern inpr-gate.yml, extended to coverunlabeled(PR Gate subscribes to both label event types; the only label the gate actually reacts to isA-release):ignored-labelgroup suffix so they cannot cancel the required run; all other events (includingA-releaselabel changes) stay in therequiredgroup.changesjob: skips on unrelated label events, sosemver-checksandchangelog-gateskip too (this also stops re-running a full semver-checks pass on every label flip).release-readinessjob: same guard, so a Mergify label flip on a release PR (which carriesA-release) doesn't spawn a redundant readiness run. Adding/removingA-releasestill re-evaluates readiness in therequiredgroup.pr-gate-resultjob: skips on unrelated label events and gets a dynamicname(mirroring theunit-testsaggregator) so the skipped run's check posts under a different name and cannot replace the requiredpr-gate-resultcheck that Mergify and branch protection consume.Net effect on a Mergify requeue: both label events land in the
ignored-labelgroup, every job skips, the run completes in seconds, no check namedpr-gate-resultis posted, and the latest required-gate result on the head is untouched.Tests
tests-unit.ymlpattern.pull_requestevents): applying/removing an arbitrary label should produce a fast skipped run under the alternate check name, without cancelling the required PR Gate run or perturbingpr-gate-result.dequeuedlabel, so the failure scenario replays exactly) and confirm it survives past the ~2-minute mark.Specifications & References
pr-gate-resultwas green)..github/workflows/tests-unit.ymlconcurrency group andunit-testsaggregator.Follow-up Work
editedevents (Mergify editing queue-draft bodies) can still race-cancel a gate run on queue drafts; the window is ~25 s and it was not the cause of the observed dequeues. Can be addressed separately if it ever bites.AI Disclosure
PR Checklist
type(scope): description