Avoid re-running CI if merge queue is empty and a merged PR is up-to-date #185061
Select Topic AreaQuestion BodyMy team's CI uses a merge queue group size is 1 and we're running exactly the same checks for PRs while they are in review and when they are in the merge queue. If the queue becomes empty, and we have a freshly approved PR which is up-to-date with the target branch and has all checks passing, adding it to the queue causes all the checks to be re-run, even though this is a waste of time and compute. Is there a way to avoid this specific scenario - have the queue checks be skipped if the PR does not need to be modified? |
Replies: 1 comment 3 replies
|
Hi @sgrzeszc, This behavior is actually intended by the Merge Queue design to guarantee safety, even though it can feel redundant in this specific scenario. When a PR enters the queue, GitHub creates a temporary merge commit to verify the integration in the current state of the queue (ensuring serialization). Even if your PR is visually up-to-date with the target branch, the system enforces this fresh check to prevent any race conditions before the final merge. Is there a way to skip it? Recommended Workaround: Hope this clarifies why the system behaves this way! |
Hi @sgrzeszc,
This behavior is actually intended by the Merge Queue design to guarantee safety, even though it can feel redundant in this specific scenario.
When a PR enters the queue, GitHub creates a temporary merge commit to verify the integration in the current state of the queue (ensuring serialization). Even if your PR is visually up-to-date with the target branch, the system enforces this fresh check to prevent any race conditions before the final merge.
Is there a way to skip it?
Currently, there isn't a native setting to "skip checks if up-to-date" specifically for the queue entry event, because the queue treats this context differently than a standard PR check.
Recommended Worka…