A failed link call leaves the target stack's membership partially mutated
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Comece com o comando gh stack link e reproduza a falha seguindo as etapas desta issue; em seguida, inspecione as chamadas que afetam a associação a repos/{owner}/{repo}/stacks/{id}. Rastreie como uma tentativa malsucedida de criação de PR lida com as alterações de associação anteriores e posteriores. A tarefa estará concluída quando um link com falha preservar a associação original a pull_requests ou relatar claramente cada alteração parcial, com verificação em relação à API.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 1.5k
- Forks
- 73
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 7
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/gh-stack
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
-
feature request topic: cli - general
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
feature request topic: auto-merge
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
bug topic: docs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
Todas as issues de github/gh-stack
Issues semelhantes
-
textual definition
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
geneontology/go-ontology#32653 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
-
needs design
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100