Partial merge leaves stale stack base and Rebase stack replays merged commits
還沒有人認領這個 Issue。
評估
研究方向
先追蹤 merge-queue admission 和 Rebase stack 路徑,重點關注部分合併後 Stack 物件的 base SHA 如何更新。重現包含八個 PR 的情境,並檢查 Rebase stack 前後回報的 base ref 和 SHA。完成的標準是:剩餘的 stack 以目前的 main 提交為目標、接納經過驗證的後綴,且不會重新播放已合併的提交。
由索引模型根據 Issue 內容生成。
描述
Reproduction
- Create a stack with a merge queue on
main. - Merge a bottom prefix of the stack, leaving eight pull requests open.
- Rebase the eight remaining branches locally onto the current
main, then force-push them as one atomic ref update. - Verify that the lowest open branch is one commit ahead of
main, zero commits behind, and that every higher branch contains the branch below it. - Verify that every open pull request is approved and has passing required checks.
- Enqueue the remaining stack from its top pull request.
All eight pull requests entered the queue within one second. Eighteen seconds later, the lowest open pull request was removed with:
github-merge-queue removed this pull request from the merge queue due to invalid changes in the merge commit
Every higher pull request was then removed because an earlier pull request in the stack was removed. No merge_group workflow was created.
The stack merge box reported that the stack was out of date with main. The pull request API reported stack.base.ref = main, but stack.base.sha still identified the last layer of the already-merged prefix rather than the current main commit.
- Click Rebase stack in the GitHub UI.
The UI reported that all eight branches were rebased and that the stack had a linear history. The actual lowest branch changed from one commit ahead and zero behind to 16 commits ahead and 15 behind. Commits already present on main reappeared in the pull request.
Expected
After a partial stack merge, GitHub updates the remaining stack's base to the current main commit and retargets the lowest open pull request to main, as described in Merging stacked pull requests.
A locally verified linear suffix based on current main should enter the merge queue. Rebase stack must use the current base commit and must not replay commits that already landed.
Actual
The remaining stack retains a stale base SHA after the partial merge. Merge-queue admission rejects a correct branch graph before creating a merge group. Rebase stack then rewrites the branches against the stale anchor and reintroduces already-merged commits.
Recovery requires restoring every branch ref, removing the stale Stack object, retargeting the lowest open pull request to main, and linking the same pull requests into a new stack.
Environment
- GitHub Stacked Pull Requests public preview.
- GitHub merge queue.
- Original stack: 26 pull requests, with 18 merged and eight open.
- All open pull requests approved and required checks passing.
gh stackv0.1.0.gh2.96.0.- git 2.50.1.
- macOS arm64.
Related
- #174 concerns approval invalidation after a partial merge. Approvals remained valid in this reproduction.
- #444 concerns a pull request being closed at a merge-group boundary. The remaining pull requests stayed open in this reproduction, but the stack base remained stale.
- 主要語言
- Go
- 星號
- 1.5k
- 分支
- 73
- 平均合併
- 13 小時 24 分鐘
- 30 天內合併 PR
- 3
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/gh-stack 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
-
難度 1/5 1 小時以內 新手友好度 92/100
-
feature request topic: cli - general
難度 2/5 1-3 小時 新手友好度 68/100
-
feature request topic: auto-merge
難度 2/5 1-3 小時 新手友好度 68/100
-
bug topic: docs
難度 1/5 1 小時以內 新手友好度 68/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
siderolabs/terraform-provider-talos#414 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
JuliaComputing/jh#63 · 1 則留言 ·
-
area/proxy kind/bug priority/backlog triage/accepted
難度 2/5 1-3 小時 新手友好度 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
維護者通常 1 天內回覆
-
Priority: Normal Type: Bug
難度 2/5 1-3 小時 新手友好度 78/100
cloudflare/cloudflared#1747 ·