A failed link call leaves the target stack's membership partially mutated
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Commencez par la commande gh stack link et reproduisez l’échec en suivant les étapes de cette issue, puis inspectez les appels qui affectent l’appartenance à repos/{owner}/{repo}/stacks/{id}. Suivez la manière dont une tentative échouée de création de PR gère les changements d’appartenance antérieurs et ultérieurs. C’est terminé lorsqu’un lien échoué conserve l’appartenance pull_requests d’origine ou signale clairement chaque modification partielle, avec une vérification par rapport à l’API.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Go
- Étoiles
- 1.5k
- Forks
- 73
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 7
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/gh-stack
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
feature request topic: cli - general
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
feature request topic: auto-merge
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
bug topic: docs
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
Toutes les issues de github/gh-stack
Issues similaires
-
textual definition
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
geneontology/go-ontology#32653 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
-
needs design
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100