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

Mid-stack PRs miss stack-aware `pull_request` triggers: PRs are created before the stack object exists

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

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

評価

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

調査の方向性

gh stack submit のフローから開始し、main に対してフィルタリングされた pull_request ワークフローを使って、4 ブランチの stack を再現します。メンバー PR が作成されるタイミング、stack が登録されるタイミング、および check suites を通じてワークフローのトリガー動作をどのように観測できるかを追跡します。すべてのメンバー PR が期待されるワークフロー実行を受け取れば完了です。これには、stack の登録前に作成された stack 中間 PR も含まれます。

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

説明

bug topic: ci
What happened

On gh stack submit, PRs are created a few seconds before the stack object itself exists. pull_request workflows with a branches: filter are evaluated against each PR's literal base at open time, so mid-stack PRs are filtered out and never dispatched. They are not re-evaluated once the stack is registered, so they permanently show no checks.

This contradicts the documented behaviour in Optimizing CI for stacked pull requests: "A workflow configured to run on pull_request events targeting main runs for every pull request in the stack."

Reproduction
  1. In a repo with the stacks preview enabled, add a workflow with:

    on:
      pull_request:
        branches: [ "main" ]
    
  2. Create a 4-branch stack and gh stack submit.

  3. Observe CI runs only on the bottom PR and the topmost PR. The middle PRs get a check suite with zero runs.

Observed timeline

Stack of 4 (PRs #10–#13, stack #14, stack.base.ref = main, size: 4):

Time (UTC) Event Workflow dispatched
13:24:13 PR #10 opened (7main) yes — literal base is already main
13:24:17 PR #11 opened (87) no — check suite 85146388656, latest_check_runs_count: 0
13:24:21 PR #12 opened (98) no — check suite 85146406327, latest_check_runs_count: 0
13:24:24 PR #13 opened (109) no — first check suite, 0 runs
13:24:26 stack #14 created (GET /repos/{owner}/{repo}/stacks/14created_at)
13:24:31 second check suite on PR #13's head yes — this is the run that appears

The bottom PR runs because its base is literally main, independent of any stack awareness. The top PR runs because its dispatch landed after stack registration at 13:24:26 and got a second check suite. PRs #11 and #12 had their opened events fully processed before the stack existed, were rejected by the branches: [main] filter, and nothing re-dispatched them afterwards.

Reproduced identically on an earlier stack of 3 in the same repo: bottom PR ran, middle skipped, top ran.

Expected behavior

Every PR in the stack is evaluated against stack.base.ref, as documented — either by creating the stack before its PRs, or by re-evaluating pull_request workflow triggers for all member PRs once the stack is registered.

Actual behavior

Only PRs whose trigger evaluation happens after stack registration get stack-aware treatment. Mid-stack PRs are silently left with no checks, which is indistinguishable from "queued" and blocks merge on repos with required checks.

Not a duplicate of
  • #319 — merge refs are healthy here: refs/pull/{10,11,12,13}/merge all exist and point at current commits, and all four PRs report mergeable: true.
  • #379 — that concerns paths filters being selected from the topmost PR. This is branches filters and a registration-ordering race; the affected PRs get a check suite with zero runs rather than a workflow selected from the wrong PR.
Workaround

Remove the branches: filter from the pull_request trigger so CI runs regardless of base.

主要言語
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 を短くまとめたダイジェスト。