Repository navigation
Stack view shows "not ready" / "unable to merge as a stack" on approved mergeable PRs (stale stack UI cache) #450
Description
Activity
Additional context from our merge experience
Some extra observations that may help reproduce or understand the limitation:
Previous images showed different strategies for merging; the first image shows
rebase and merge stack, and the second imageshows squash and merge stackStack had two PRs that needed to preserve full git history
PRs #7 and #9 in this stack contained imported history from other repositories (940 and 879 commits respectively, including merge commits). These two PRs must keep all their original commits and SHAs to preserve provenance.
The other 11 PRs were fine being squashed to 1 commit each.
Problem: gh stack merge supports only one merge method
gh stack merge --yes --squashwould collapse the import history — not acceptable.
gh stack merge --yes --rebasewould try to replay 940+879 commits onto the base, rewriting SHAs and linearizing internal merge topology — also not acceptable.
gh stack merge --yes --merge(merge commits for all) was the only viable option, but it forced merge commits even on the 11 PRs that ideally would have been rebase-merged for a linear first-parent history.What would help: a way to mark specific PRs in the stack for different merge methods, e.g.:
gh stack mark --merge #7 --rebase #9 # hypothetical gh stack merge --respect-marksOr at minimum, allow
--rebase+--mergeas a mixed option where rebase is the default but a merge commit is used when the PR's branch is not a fast-forward descendant of its target.Stack linearity check was too strict after local branch restructuring
After squashing the non-import branches locally (via
git reset --soft+git commit), the stack was no longer linear: the import branches still pointed at their old parent histories, not the new squashed commits.gh stack mergerefused with:Stack needs to be rebased: PR #8's branch is not a linear descendant of PR #7's branch.We had to fix this manually by:
- Rebase-fixing the child of each import branch (
git rebase --onto <new-tip> <old-tip>) - Merging the import branches into their new parents (
git merge --no-ff) to make them descendants while preserving their history SHAs - Force-pushing all 13 branches, then running
gh stack merge --yes --merge
This worked, but the manual re-parenting required deep git knowledge and trial-and-error. A
gh stack repaircommand that automatically re-parents branches after local squashes would save a lot of effort.The original issue title (stack UI "not ready") was resolved by waiting
The GitHub native stack view eventually resolved itself. The "not ready" / "unable to merge as a stack" messages were transient — after ~10-30 minutes per PR (the stack had 13 PRs with many commits), the native UI updated and allowed stacking. So that part was just a stale UI cache.
Reacted by Ben Rhodes and Calum Crawford- Rebase-fixing the child of each import branch (
- addedbugBug ReportsBug Reportstopic: mergeabilityAuto-mergeability detection for stacked PRs is broken.Auto-mergeability detection for stacked PRs is broken.
on Aug 24, 2026 Seeing this with just 2 PRs in a stack. UI tells me "Able to merge as a stack", then I press the "merge stack" button and it fails with "stack merge was automatically disabled 6 minutes ago. Pull Request is not mergeable".
++


Summary
The GitHub stack view (native stack feature, not CLI) shows "not ready" on some PRs in a 13-level stack, and displays "unable to merge as a stack" globally, even though every PR in the stack reports
mergeable=MERGEABLE,mergeStateStatus=CLEAN(orUNSTABLE),reviewDecision=APPROVED, and all status checks passing via both REST and GraphQL APIs.Stack structure (anonymized)
13 PRs in total. The bottom PR targets
base-branch; each subsequent PR targets its predecessor's branch. All PRs are open, non-draft, created viagh stack submit.Environment
gh2.97.0gh-stackv0.1.0Observed behavior
In the GitHub stack UI (native stack view)
Via the API (both REST and GraphQL, confirmed multiple times over several minutes)
Every PR in the stack (including #8 and #10) consistently reports:
mergeableMERGEABLEmergeStateStatusCLEAN(orUNSTABLE— only non-required checks pending like CodeRabbit)reviewDecisionAPPROVED(multiple approvals from different reviewers)statusCheckRollup.stateSUCCESSisDraftfalserequested_reviewers[](no pending reviewer requests)GraphQL query used:
{ repository(owner: "O", name: "R") { pullRequest(number: N) { mergeable mergeStateStatus reviewDecision isDraft statusCheckRollup { state } } } }Context about the "not ready" PRs (#8 and #10)
gh stack submitflow, all with the same review/check configuration.Attempted workaround: close + reopen the "not ready" PRs
We closed and reopened PR #8 (the first "not ready" PR in the stack) to force a full server-side recompute:
Result:
mergeable=MERGEABLE, reviewDecision=APPROVEDcorrectly.Close+reopen did not invalidate the stack view's cached state. The stack view appears to maintain its own independent cache that is not invalidated by PR state changes.
Expected behavior
Given that:
MERGEABLE).APPROVED).SUCCESS).GitHub's native stack view should reflect the actual PR state and show all 13 PRs as "Ready", with the "Merge stack (13)" option enabled and functional. A stale cached state rendering the stack unmergeable is a blocking UX bug.
Related
MERGEABLE/CLEAN/APPROVEDsymptom. Our close+reopen attempt did not resolve it, suggesting a different cache invalidation path.