A failed link call leaves the target stack's membership partially mutated
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia con il comando gh stack link e riproduci il fallimento seguendo i passaggi di questa issue, quindi esamina le chiamate che influiscono sull’appartenenza a repos/{owner}/{repo}/stacks/{id}. Traccia il modo in cui un tentativo fallito di creazione di una PR gestisce le modifiche all’appartenenza precedenti e successive. Il lavoro è completato quando un link fallito conserva l’appartenenza originale a pull_requests oppure segnala chiaramente ogni modifica parziale, con verifica rispetto all’API.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When gh stack link fails partway through (see #373 for one way to trigger this), the stack's membership on GitHub is left altered rather than restored — PRs that were part of the stack before the failed call are silently dropped from it, with no rollback and no mention of this in the command's error output.
Repro
- Build a stack
main <- a <- b <- c <- d <- eviagh stack link. Confirm viagh api repos/{owner}/{repo}/stacks/{id}that all 5 PRs are listed underpull_requests. - Merge
aandb. Closecwithout merging. - Run
gh stack link a b c d e --base mainto fixd's base (see #373) — it fails while trying to create a duplicate PR fora. - Re-check the stack's membership:
gh api repos/{owner}/{repo}/stacks/{id} --jq '.pull_requests[].number'.
Actual
Before step 3, the stack listed all 5 PRs. After the failed link call in step 3, the stack's pull_requests field lists only the merged PRs (a, b) — c, d, and e are gone from the stack entirely, even though d and e were never touched by the failed create attempt (only the lookup step "found" them, per #373's output).
This is also visible in the GitHub UI: PRs that previously showed a "Part of a stack" banner no longer show it at all.
I did not attempt to trigger this deliberately — it was an unwanted side effect discovered while working around #373 and #372.
Expected
Either:
- The whole
linkoperation should be atomic: a failure partway through (e.g. an individual PR-creation error) should not leave the stack's membership altered from before the call, or - If partial application is intentional/unavoidable, the command should clearly report which stack-membership changes actually took effect before it errored out, so the caller can reconcile the difference instead of discovering it later via the API or UI.
Environment
gh-stack version 0.0.8, installed via gh extension install github/gh-stack.
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 73
- Merge medio
- 1g 8h
- PR unite (30g)
- 7
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/gh-stack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
feature request topic: cli - general
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
feature request topic: auto-merge
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug topic: docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Tutte le issue di github/gh-stack
Issue simili
-
textual definition
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
geneontology/go-ontology#32653 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
needs design
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100