Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

A failed link call leaves the target stack's membership partially mutated

Abierto
#374 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
github, go
Área
api, cli

Línea de trabajo

Empieza con el comando gh stack link y reproduce el fallo siguiendo los pasos de este issue; después inspecciona las llamadas que afectan a la pertenencia a repos/{owner}/{repo}/stacks/{id}. Sigue cómo un intento fallido de creación de una PR gestiona los cambios de pertenencia anteriores y posteriores. Se considera terminado cuando un enlace fallido conserva la pertenencia original a pull_requests o informa claramente de cada cambio parcial, con verificación contra la API.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug topic: cli - link

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

  1. Build a stack main <- a <- b <- c <- d <- e via gh stack link. Confirm via gh api repos/{owner}/{repo}/stacks/{id} that all 5 PRs are listed under pull_requests.
  2. Merge a and b. Close c without merging.
  3. Run gh stack link a b c d e --base main to fix d's base (see #373) — it fails while trying to create a duplicate PR for a.
  4. 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 link operation 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.

Lenguaje dominante
Go
Estrellas
1.5k
Forks
73
Merge medio
1 d 8 h
PR fusionados (30 d)
7

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/gh-stack

Todos los issues de github/gh-stack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.