Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#374 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
github, go
領域
api, cli

調査の方向性

gh stack link コマンドから始め、この issue の手順で失敗を再現してから、repos/{owner}/{repo}/stacks/{id} のメンバーシップに影響する呼び出しを調べます。PR 作成の試行に失敗した場合に、それ以前およびそれ以降のメンバーシップ変更がどのように処理されるかを追跡します。失敗したリンクが元の pull_requests メンバーシップを保持するか、部分的な変更をすべて明確に報告し、API に対して検証できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
1.5k
フォーク
73
平均マージ
1日 8時間
マージ済み PR(30日)
7

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-stack のほかの issue

github/gh-stack の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。