Merge queue removes stacked child PRs with invalid_merge_commit under squash merge method #223
laurynasgrape
started this conversation in
Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
With a merge queue configured to squash merging, enqueueing a native stack via "Enqueue stack" reliably fails: the bottom PR (base = default branch) stays queued, but the stacked child is removed within ~15–20 seconds with reason
invalid_merge_commit(UI: "github-merge-queue bot removed this pull request from the merge queue due to invalid changes in the merge commit"). The removal happens before any checks complete, so it looks like merge-commit validation rather than a CI failure.The overview docs state that squash merges are fully supported for stacks and that merging a stack is a single atomic operation, so this appears to be a bug rather than a documented limitation.
Setup
mainmergeMethod: SQUASH,mergingStrategy: ALLGREEN(squash is the only merge method allowed on the repo)main) and PR-3 (base = PR-2's branch) were both approved with all checks green, and the stack view showed "Able to merge as a stack" with an "Enqueue stack 2" buttonExpected
Clicking "Enqueue stack" merges PR-2 and PR-3 atomically through the queue, each as its own squash commit.
Actual
Both PRs enter the queue; seconds later the child is kicked.
RemovedFromMergeQueueEventtimeline data (via GraphQL) across two days, six attempts:invalid_merge_commit~15 s afterAddedToMergeQueueEvent, and the child cascaded out withstack_out_of_order.main) stayed queued inAWAITING_CHECKS, and the child was removed withinvalid_merge_commit17 s after being added — while its parent was still unmerged in the queue.In every case the removed PR reported
mergeable: MERGEABLE/mergeStateStatus: CLEANimmediately afterwards.Workaround
Serial enqueueing works every time: let the bottom PR merge through the queue, wait for the child to retarget to
mainand get rebased, then enqueue it alone. Only the multi-entry "Enqueue stack" path fails.Hypothesis
Under squash, the queue appears to build and validate the child's speculative merge commit against a base state that doesn't yet include the parent's squashed result (the child branch still carries the parent's pre-squash commits), so the validation "changes in the merge commit match the PR" fails. The stack-aware rebase that makes serial merging work doesn't seem to happen before the in-queue validation of later stack entries.
Happy to share repo/PR identifiers and exact timestamps privately if useful for debugging.
Beta Was this translation helpful? Give feedback.
All reactions