Skip to content

Can't merge a stacked PR with no clear reason (all PRs show mergeable) #323

Open

Description

@mr04vv

Environment

  • develop branch are protected by a repository ruleset with:
    • require_last_push_approval: true
    • dismiss_stale_reviews_on_push: true
    • required status checks
    • No merge queue.

Reproduction

  1. Create a 3-level stack: develop <- A <- B <- C.
  2. Approve every PR after its latest push. All three show MERGEABLE / CLEAN / APPROVED, all checks green.
  3. On the top PR (C), the native GitHub "Merge stack (3)" box shows "Able to merge as a stack". Click it (merge method: Create
    a merge commit) and confirm.

Expected

All three PRs merge into develop, or the operation stops before anything merges.

Actual

  • UI shows "Merging stack… / 3 pull requests are being merged" briefly, then rolls back to "Able to merge as a stack". Nothing
    merges.
  • The PR event log records repeated auto-merge was automatically disabled — "Pull Request is not mergeable".

(In the image, the bottom PR has been merged, but the behavior remains the same even if it is not merged.)
Image
Image
Image

Notes

Activity

  1. shanegrouber commented on Jul 27, 2026

    @shanegrouber

    Same class of failure on a 3-PR stack without a merge queue (repo: private product stack, trunk master).

    Setup

    • Stack: master <- #A <- #B <- #C (all open, squash intended)
    • Every PR: mergeStateStatus=CLEAN, mergeable=MERGEABLE, reviewDecision=APPROVED, required checks green
    • No merge queue on the repo
    • Clicked Merge stack from the tip (#C)

    Actual

    • UI stuck on “Merging stack… / 3 pull requests are being merged” with all three rows showing Merging
    • API after several minutes:
      • #C (tip): autoMergeRequest enabled (squash), baseRefName still the middle branch (not trunk)
      • #A and #B: still OPEN, autoMergeRequest: null, bases unchanged
      • Trunk tip unchanged — nothing merged
    • So the stack job appears to arm auto-merge only on the tip. Tip cannot merge until lower PRs land and bases retarget; lower PRs were never started → deadlock (infinite “Merging…” rather than a clean rollback)

    Contrast with this issue’s “rollback” path

    In your report the UI returns to “Able to merge as a stack” and logs auto-merge disabled / not mergeable. We stayed in the merging state with only tip AM on. Same broken bottom-up orchestration; different UI terminal state.

    Workarounds that work

    • Cancel stack merge → merge bottom-up (or enable auto-merge on #A first), accepting per-layer CI after each squash
    • Or retarget tip to trunk and merge tip only (full stack in one squash), close lower PRs as superseded

    Happy to pull more GraphQL/API snapshots if useful.

  2. Molly-Guan commented on Jul 29, 2026

    @Molly-Guan

    same problem,it is really a big blocker

  3. leettaylor commented on Jul 30, 2026

    @leettaylor

    There's now a stack merge command and when running that I see the following error.

    ✗ merge failed: protected branch 'main' check failed:
      At least 1 approving review is required by reviewers with write access.
    Stack merges are atomic, so nothing was merged.
    

    All PRs in the stack have a relevant review.

  4. mobot11 commented on Jul 30, 2026

    @mobot11

    There's now a stack merge command and when running that I see the following error.

    ✗ merge failed: protected branch 'main' check failed:
      At least 1 approving review is required by reviewers with write access.
    Stack merges are atomic, so nothing was merged.
    

    All PRs in the stack have a relevant review.

    The error I see is slightly different

    Merging #55023, #55024, #55025 into master via squash...
    ✗ merge failed: Repository rule violations found
    
    Waiting on 1 reapproval from someone other than the last pusher. Reviews from ***** and ***** are stale because they were submitted before the merge base changed.
    
    
    Stack merges are atomic, so nothing was merged.
    
  5. Molly-Guan commented on Jul 31, 2026

    @Molly-Guan

    There's now a stack merge command and when running that I see the following error.

    ✗ merge failed: protected branch 'main' check failed:
      At least 1 approving review is required by reviewers with write access.
    Stack merges are atomic, so nothing was merged.
    

    All PRs in the stack have a relevant review.

    The error I see is slightly different

    Merging #55023, #55024, #55025 into master via squash...
    ✗ merge failed: Repository rule violations found
    
    Waiting on 1 reapproval from someone other than the last pusher. Reviews from ***** and ***** are stale because they were submitted before the merge base changed.
    
    
    Stack merges are atomic, so nothing was merged.
    

    The error I see is slightly different

    ❯ gh stack merge
    ✗ merge failed: Repository rule violations found

    Waiting on code owner review from xxx.

    Stack merges are atomic, so nothing was merged.

    BUT!!!,oddly,i can merge one by one from the first branch,no error occured,so i guess something must be wrong but not me

  6. Happycoil commented on Jul 31, 2026

    @Happycoil

    Also encountering this. UI button is green, but fails without any obvious errors. CLI fails like this even though the entire stack is approved:

    Merging #XXX, #XXX, #XXX, #XXX into main via rebase...
    ✗ merge failed: Repository rule violations found
    Waiting on code owner review from org/reviewer-group.
    
    Stack merges are atomic, so nothing was merged.
    

    Merging the stack from the bottom changes the base of the rest of the stack, which re-triggers checks and also dismisses reviews depending on your repo's settings. So in the best case you might be able to merge without getting a new approval, but it will be a slow process depending on how many PRs are stacked.

    It's kinda strange for a problem like this to even reach public preview. It looks exactly like the same class of problem other stack tools which don't use a merge bot (spr, ghstack, etc) have been hamstrung by for years. Many basic review hardening settings (like "dismiss stale reviews on push", "require last push approval", etc) completely break the core functionality, so it's a very common complaint. Surely prior art was looked at when creating this tool?

  7. cyberhck commented on Aug 5, 2026

    @cyberhck

    Surely prior art was looked at when creating this tool?

    You'd think. I'm facing the same issue, I used to use graphite and switched to gh stack and the fact the API for those were similar was cherry on top. However gh stack doesn't solve anything that graphite didn't except gh stack is free to use.

  8. SpyrosBou commented on Aug 6, 2026

    @SpyrosBou

    Reproduced with gh stack v0.1.0 and Dismiss stale pull request approvals when new commits are pushed enabled.

    All involved PRs display Changes approved in the GitHub UI.

    Observed behaviour

    Merging one PR at a time succeeds

    Sequentially merging each PR works through both interfaces:

    • Merging one PR at a time through the GitHub web UI succeeds.
    • Merging one PR at a time through GitHub CLI succeeds:
    gh stack merge PR-A
    ✓ Merged PR-A into the base branch
    
    gh stack merge PR-B
    ✓ Merged PR-B into the base branch
    
    gh stack merge PR-C
    ✓ Merged PR-C into the base branch
    

    Merging multiple PRs at once fails

    Attempting to merge multiple approved PRs as one stack operation fails through both interfaces:

    • The web UI shows Changes approved, Able to merge as a stack, and an enabled Merge stack 2 button, but the multi-PR merge does not complete.
    • The equivalent CLI operation fails:
    gh stack merge TOP-PR
    Merging LOWER-PR, TOP-PR into the base branch via merge...
    ✗ merge failed: Repository rule violations found
    
    Waiting on required approvals from REQUIRED-REVIEWER-TEAM.
    
    Stack merges are atomic, so nothing was merged.
    

    The same PRs therefore satisfy the repository rules when merged sequentially but fail approval validation when included in a multi-PR stack merge.

    Possible relationship to stale-review dismissal

    When a lower PR merges, GitHub Stack rebases and force-pushes the branches above it, creating new commit identifiers and changing their merge bases. With stale-review dismissal enabled, those rewritten upper PRs may require reapproval.

    The multi-PR merge validator may be evaluating approvals against the internally rewritten upper branches and treating them as stale. However:

    • The UI continues to show all included PRs as approved and advertises the multi-PR operation as ready.
    • Sequential merges continue to accept the approvals through both the UI and CLI.

    This indicates inconsistent approval handling between:

    1. Sequential single-PR merges through the web UI
    2. Sequential single-PR gh stack merge commands
    3. Multi-PR merges through the web UI
    4. Multi-PR gh stack merge commands

    Expected behaviour

    Approval validation should be consistent between sequential and multi-PR stack merges.

    If stale-review dismissal makes the multi-PR operation invalid, the UI must not display Able to merge as a stack or enable the multi-PR merge button. It should identify which PRs require reapproval before offering the operation.

  9. rsimpsonap commented on Aug 6, 2026

    @rsimpsonap

    Ran into the same issue with Dismiss stale pull request approvals when new commits are pushed enabled. I understand why it breaks, but it was surprising and I'd expect GitHub to special case those ruleset options so you don't have to continuously re-request reviews.

    GH really should provide a better error message here too, at least.

  10. added
    bugBug Reports
    topic: mergeMerging a stack from the UI hangs, gets stuck, or fails; partial-merge and auto-merge breakage.
    on Aug 11, 2026
  11. voidlily commented on Aug 11, 2026

    @voidlily

    Ran into this issue today as well

    • Private repo
    • Stack of 3 PRs
    • "Dismiss stale reviews" setting enabled on the repo

    Auto merging from the final PR hangs forever, but canceling it and merging one at a time works as a clunky and slow workaround as then every step has to rerun the PR checks.

  12. dman64w commented on Aug 13, 2026

    @dman64w

    Also had this issue.

    • Organisation Repo
    • 3 PR stack
    • Dismiss Stale Reviews enabled
    • Commit message requirements (We put our JIRA ticket code in our message)

    But because of point 3 I have not been able to validate point 4. In the CLI I get the warning about approvals being required.

    But I shouldn't have to get the error message via the CLI if the UI is there on the website, nor should I have to manually merge each PR to work around my requirements as it otherwise defeats the point of the stacked PRs.

  13. mateo-di commented on Aug 14, 2026

    @mateo-di

    We're seeing the exact same thing you described — spinner shows "Merging stack…" then rolls back, event log says "Pull Request is not mergeable" despite every PR showing mergeable/approved. Also confirmed your hypothesis: our target branch has classic branch protection with require_last_push_approval: true and a separate ruleset on the same branch with dismiss_stale_reviews_on_push: true.

    GitHub enforces the stricter of the two wherever they overlap, so in effect every push (including the synthetic ones from cascading rebases after a lower PR merges) dismisses stale approvals and requires a fresh last-push approval — which lines up with approvals silently going stale right before the stack-merge check. No merge queue involved on our end either, so that's consistent with your report.

  14. BrendanDriveCentric commented on Aug 18, 2026

    @BrendanDriveCentric

    Same failure, but with a path-scoped team requirement rather than an
    approval count:

    ✗ merge failed: Repository rule violations found
    
    Waiting on required approvals from <org>/<gatedfolder-team>.
    

    2-PR stack. Only the upper PR touches .gatedfolder/, matching a
    required_reviewers rule scoped to [".gatedfolder/**"]. That approval
    exists - on behalf of the team, on the current head SHA:

    {
    	"state": "APPROVED",
    	"onBehalfOf": [
    		{
    			"slug": "<gatedfolder-team>"
    		}
    	],
    	"commit": "<head-sha>"
    }

    Both PRs CLEAN / APPROVED, checks green. Not stale, unlike @mobot11's case.

    Versions: gh 2.97.0, gh-stack v0.1.0.

    Should onBehalfOf team approval satisfy a path-scoped required_reviewers
    rule during a stack merge?

  15. 16 remaining items

  16. kumboleijo commented on Sep 17, 2026

    @kumboleijo

    For us the solution was to disable Require approval of the most recent reviewable push. Dismiss stale pull request approvals when new commits are pushed alone was not working.

    Image
  17. byronc-synthrics commented on Sep 19, 2026

    @byronc-synthrics

    We had the same issue, I can confirm that turning off dismiss_stale_reviews_on_push also solved it for us. I guess we can live without it 🤷‍♂️

    I'd push back on leaving it off. dismiss_stale_reviews_on_push is what keeps an approval tied to the commits that were actually reviewed. With it disabled, an approval survives every later push, so code can land on a protected branch that no one has looked at. That's a weaker control than most compliance baselines assume you have, and it applies to every PR in the repo, not only the stack you're trying to merge.

    Turning it off to unblock a stack is reasonable as a one-off. Turn it back on the moment the stack is merged, and re-request review on anything that was pushed while it was off.

  18. isnoto commented on Sep 23, 2026

    @isnoto

    Also reproducing this on September 23, 2026, with an eight-PR native stack in a private repository, using Squash and merge stack in the GitHub web UI.

    Before the merge attempt, the UI showed every PR as Ready, with approvals and checks passing. Clicking Confirm squash and merge stack changed the status to “Merging…” and then failed with:

    protected branch 'master' check failed: Waiting on code owner review from <org>/owners and/or <org>/qa.
    

    Team names above are anonymized.

    I've checked the API after the failed attempts:

    • All eight PRs reported reviewDecision: APPROVED and mergeStateStatus: CLEAN.
    • Each PR had a non-dismissed approval on its exact current head SHA, submitted on behalf of the QA code-owner team.
    • The reviewer’s QA team membership was active.
    • The relevant CODEOWNERS rule lists both teams on the same line:
      * @<org>/qa @<org>/owners
      
    • The stack’s top branch contained every lower PR head and was up to date with master.
    • All eight PRs remained open; nothing was merged.

    Multiple attempts produced the same result: GitHub showed all eight PRs as ready, and the API reported APPROVED / CLEAN, but the stack merge failed with a missing code-owner review error. Nothing was merged.

  19. adriancuadrado commented on Sep 23, 2026

    @adriancuadrado

    As a workaround, merging the PRs one by one works. But you will probably have to wait for the PR checks to run every time you merge one PR of the stack to merge the next one.

    I use gh stack merge and then I make sure only the bottom PR is selected each time I want to merge a PR. Not ideal, but it's something.

  20. glitchedmob commented on Sep 23, 2026

    @glitchedmob

    I hit the same issue in a 3 PR stack. I tried several different settings to try and isolate what was causing it

    Every PR: APPROVED, CLEAN, MERGEABLE. Approval from a member of the code owner team, recorded onBehalfOf that team. No pending review requests. No review_dismissed events anywhere.

    Squash and merge on the top PR:

    Repository rule violations found
    Waiting on code owner review from ORG/TEAM.
    

    Ran the combinations:

    dismiss_stale_reviews_on_push require_last_push_approval strict Result
    true true true fails, "Waiting on code owner review"
    true false true fails, same message
    true false false fails, same message
    false true true fails, different message
    false false true merges

    Same on classic branch protection and on a ruleset. strict made no difference.

    Row 4 is where the error message changes to:

    Waiting on 1 reapproval from someone other than the last pusher.
    Review from REVIEWER is stale because it was submitted before the merge base changed.
    

    Everything I'm seeing in the Github docs for stacks says we shouldn't see this and so I'm thinking there might be a bug in stacks or a new setting that should be added to allow some of these to be bypassed for stacks.

  21. jebeaudet commented on Sep 23, 2026

    @jebeaudet

    If you have the right to enable the merge queue on the repo, do it, merge your approved stacked PR and remove it after and it will work. Your workflows need to be compatible with the merge queues but it works.

  22. gitjiggywithit commented on Sep 25, 2026

    @gitjiggywithit

    I hit the same issue in a 3 PR stack. I tried several different settings to try and isolate what was causing it

    Every PR: APPROVED, CLEAN, MERGEABLE. Approval from a member of the code owner team, recorded onBehalfOf that team. No pending review requests. No review_dismissed events anywhere.

    Squash and merge on the top PR:

    Repository rule violations found
    Waiting on code owner review from ORG/TEAM.
    

    Ran the combinations:
    dismiss_stale_reviews_on_push require_last_push_approval strict Result
    true true true fails, "Waiting on code owner review"
    true false true fails, same message
    true false false fails, same message
    false true true fails, different message
    false false true merges

    Same on classic branch protection and on a ruleset. strict made no difference.

    Row 4 is where the error message changes to:

    Waiting on 1 reapproval from someone other than the last pusher.
    Review from REVIEWER is stale because it was submitted before the merge base changed.
    

    Everything I'm seeing in the Github docs for stacks says we shouldn't see this and so I'm thinking there might be a bug in stacks or a new setting that should be added to allow some of these to be bypassed for stacks.

    Piling on here, I had the same error as @glitchedmob and confirmed that disabling dismiss_stale_reviews_on_push allowed the stack merge to complete. That does seem like unexpected behavior though because the reviews do not get dismissed if the PRs are merged one-by-one (i.e. there's no diff when the base changes). Hopefully the devs can fix it 🤞

  23. joshbrw commented on Sep 28, 2026

    @joshbrw

    We are also facing this issue. All of the PRs within the stack are showing as Mergeable, but when attempting to merge the stack we are receiving the error:

    Repository rule violations found Waiting on code owner review from team/team
    
  24. tolzhabayev commented on Sep 29, 2026

    @tolzhabayev

    Same here on a 3 PR stack, squash only, no merge queue. The main ruleset has dismiss_stale_reviews_on_push, require_last_push_approval and code owner review on.

    A couple of things I haven't seen in the thread yet:

    • The web UI did tell me why before I confirmed. "Confirm squash and merge stack (3)" showed "Review from X is stale because it was submitted before the merge base changed. Waiting on 1 reapproval from someone other than the last pusher." Nothing had been pushed since the approvals and main hadn't moved, so the approval on the top PR looks like it gets checked against main instead of the parent branch it was approved against.
    • Retargeting the top PR to main to merge everything as one squash is blocked too ("Cannot change the base branch because the pull request is part of a stack").
    • Merging bottom up works, but after each squash the next PR goes DIRTY because its branch still has the original commits of the PR that was just squashed. The squash tree was identical to the old head, so git merge -s ours origin/main on the next branch fixed it without changing any files. That's another push though, so each PR then needs a fresh approval.
  25. benlangfeld commented on Sep 30, 2026

    @benlangfeld

    @imanmahjoubi is this going to get looked at?

  26. Gu1nness commented on Oct 1, 2026

    @Gu1nness

    Hi !
    I have the same issue:
    Stacked PR with a few PRs.
    Protected branch with:

     - required_approving_review_count : 2
     - squash_merge: true
    

    Two PRs are ready to merge, both got 2 approvals.
    I click Squash and merge and it fails with At least 2 approving reviews are required by reviewers with write access..
    Also fails with the same message on CLI.

    I can merge it one after the other manually, and it succeds.
    However the stacked PR merge fails.

  27. ValentinRLL commented on Oct 1, 2026

    @ValentinRLL

    My team has the same issue and we do not want to disable "Dismiss stale pull request approvals".

  28. joyhchen commented on Oct 1, 2026

    @joyhchen

    @ValentinRLL You basically have two options:

    1. You can use merge queues, which support keeping Dismiss stale pull request approvals while merging an entire stack
    2. You accept you must merge the PRs one by one

    GitHub has only acknowledged the issue by attaching the "bug" label to this issue. You can see a stacked PRs PM added a label to the issue. I have raised the issue to GitHub, but didn't receive an acknowledgement.

    I believe all this confusion can be solved by adding a tooltip saying what I said above ^^^ even if they don't actually fix the issue.

    Also recapping earlier comments:

    • turning off Dismiss stale pull request approvals is not an option for the majority of companies for compliance reasons
  29. josh-acay commented on Oct 1, 2026

    @josh-acay

    Merge queues do not support keeping Dismiss stale pull request approvals. See #174.

  30. joyhchen commented on Oct 1, 2026

    @joyhchen

    Hmm, it worked in our repos and there are other reports of merge queues supporting it with Dismiss stale pull request approvals. It sounds like there is some other setting impacting this. LIke maybe there is something in other folks' CI config. In any case, merging the entire stack works inconsistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug Reportstopic: mergeMerging a stack from the UI hangs, gets stuck, or fails; partial-merge and auto-merge breakage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions