unstack shows a generic/incorrect error instead of the real API rejection reason
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 67/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện gh stack unstack <number> trên một stack có các pull request đã được merge, đồng thời so sánh đầu ra thông thường với GH_DEBUG=api. Theo dõi việc xử lý lỗi của unstack và phản hồi 422 của REST API; được xem là hoàn tất khi đầu ra không ở chế độ debug báo cáo lý do từ chối thực tế thay vì thông báo queued-for-merge không liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
gh stack unstack <number> fails on a stack containing merged PRs, but the plain (non-debug) error message names an unrelated cause. The actual server-side reason is only visible with GH_DEBUG=api.
Repro
- Create a stack with
gh stack link(orsubmit), e.g.main <- a <- b <- c <- d <- e. - Merge
aandb(via merge queue or a normal merge — doesn't matter which). - Run
gh stack unstack <number>on that stack.
Actual
⚠ Some pull requests are queued for merge or have auto-merge enabled and remain stacked on GitHub
The stack was left in place — local tracking is unchanged
I verified via gh api graphql that none of the stack's PRs had autoMergeRequest set or a mergeQueueEntry — so the stated reason doesn't match reality.
Running the identical command with GH_DEBUG=api gh stack unstack <number> shows the real HTTP exchange:
POST /repos/{owner}/{repo}/stacks/{id}/unstack
< HTTP/2.0 422 Unprocessable Entity
{
"message": "Pull requests #.. , #.. cannot be removed from this stack",
"documentation_url": "https://docs.github.com/rest/pulls/stacks#remove-pull-requests-from-a-pull-request-stack",
"status": "422"
}
Interestingly, in the GH_DEBUG=api run the CLI's own final stderr line correctly echoed this specific message (✗ Unstacking not allowed: Pull requests #.., #.. cannot be removed from this stack) — a materially different, and accurate, explanation compared to the generic message shown without debug logging.
Expected
The non-debug error message should reflect the actual REST API rejection (a stack can't be unstacked once any of its PRs have merged), not a generic, unrelated "queued for merge / auto-merge enabled" message.
Environment
gh-stack version 0.0.8, installed via gh extension install github/gh-stack.
- 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ự
-
textual definition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
geneontology/go-ontology#32653 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
needs design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100