Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

gh stack submit falsely reports stack recreation when no replacement stack is persisted

Ouverte
#406 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Calme
Stack technique
github, go
Domaine
api, cli

Piste de recherche

Commencez par le flux gh stack submit et reproduisez l’état signalé à l’aide des vérifications non mises en cache de gh api pour la stack et une PR ouverte. Suivez la recréation de la stack via la persistance distante et les mises à jour locales de .git/gh-stack. C’est terminé lorsque les échecs renvoient une valeur différente de zéro et que le succès n’est affiché qu’après vérification de la stack de remplacement et de l’appartenance attendue de la PR.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug topic: cli - submit
Summary

gh stack submit reports that a modified stack was successfully recreated on GitHub, but no replacement stack exists afterward.

Branches and PR bases are pushed successfully. Open PRs become unstacked, local metadata retains the old closed stack ID, and the command still exits with success output.

Environment
  • gh version 2.97.0
  • gh stack version 0.1.0
  • macOS 26.6
  • Repository has GitHub Stacks enabled
Setup

Existing remote stack:

  • One merged bottom PR
  • Multiple open PRs
  • One closed PR in the middle

Locally:

  1. Check out remote stack.
  2. Run gh stack modify.
  3. Drop the closed middle PR.
  4. Resolve cascading rebase conflicts.
  5. Run gh stack submit.
Actual output
Found the stack on GitHub — updating it to match your local stack
Merged PRs have left the stack on GitHub, so it wasn't updated — your unmerged PRs were pushed and re-based onto the trunk
✓ Stack recreated on GitHub to match local state
✓ Pushed and synced 47 branches
Actual remote state

The branches were pushed, but no replacement stack was created.

Repeated uncached API checks showed:

gh api -H 'Cache-Control: no-cache' \
  repos/OWNER/REPO/pulls/OPEN_PR \
  --jq '.stack'

Result:

null

Listing repository stacks showed only the old closed stacks:

gh api -H 'Cache-Control: no-cache' \
  'repos/OWNER/REPO/stacks?per_page=100'

The old stack remained closed with only its merged PR. No new stack number appeared.

This was checked three times over 12 seconds. Direct PR membership and the stack list remained unchanged.

Local .git/gh-stack still referenced the old closed stack number and ID.

Expected behavior

One of:

  1. A replacement remote stack is persisted and local metadata is updated to its new number and ID.
  2. Stack creation failure is reported with a non-zero exit code.

The command must not print:

✓ Stack recreated on GitHub to match local state

unless the remote stack exists and its PR membership has been verified.

Impact
  • User believes stack recreation succeeded.
  • GitHub UI contains no open stack.
  • Every open PR has stack: null.
  • Local metadata points to a closed historical stack.
  • Subsequent checkout, sync, and modify operations begin from inconsistent state.
Suggested safeguard

After creating or recreating the stack:

  1. Read the returned stack ID and number.
  2. Query the stack or one member PR.
  3. Verify expected membership.
  4. Only then persist local metadata and print success.

If verification fails, retain recovery state and return an error.

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

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de github/gh-stack

Toutes les issues de github/gh-stack

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.