Partial merge leaves stale stack base and Rebase stack replays merged commits
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các đường dẫn merge-queue admission và Rebase stack, tập trung vào cách base SHA của đối tượng Stack được cập nhật sau một lần merge một phần. Tái hiện kịch bản tám PR và kiểm tra base ref cùng SHA được báo cáo trước và sau Rebase stack. Được xem là hoàn tất khi stack còn lại trỏ đến commit main hiện tại, chấp nhận một hậu tố đã được xác minh và không phát lại các commit đã được merge.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 1.5k
- Fork
- 73
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 7
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/gh-stack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
feature request topic: cli - general
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
feature request topic: auto-merge
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug topic: docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Tất cả issue của github/gh-stack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Broadcast Documentation Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
kovidgoyal/kitty#10516 ·
-
CVE-2024-24786 CPE mismatch Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
cisagov/vulnrichment#337 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100