unstack shows a generic/incorrect error instead of the real API rejection reason
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 67/100
Rechercherichtung
Beginne damit, gh stack unstack <number> auf einem Stack mit gemergten Pull Requests zu reproduzieren und die normale Ausgabe mit GH_DEBUG=api zu vergleichen. Verfolge die Fehlerbehandlung von unstack und die 422-Antwort der REST API; als erledigt gilt die Aufgabe, wenn die Ausgabe ohne Debugging den tatsächlichen Ablehnungsgrund statt der nicht dazugehörigen Meldung queued-for-merge meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Go
- Sterne
- 1.5k
- Forks
- 73
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 7
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/gh-stack
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
-
feature request topic: cli - general
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
feature request topic: auto-merge
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
bug topic: docs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
Alle Issues in github/gh-stack
Ähnliche Issues
-
textual definition
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
geneontology/go-ontology#32653 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
-
needs design
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100