A stacked pull request cannot use auto-merge

未关闭
#504 0 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
github, go
领域
cli, devops

调研方向

gh stack link 命令开始,使用 issue 中的双层场景重现被拒绝的情况。结合相关 issue #174、#172、#502 和 #503,阅读 auto-merge 和 stack linking 的处理方式。完成的标准是:堆叠的 pull request 可以保留 auto-merge,或者命令和 stack 面板明确说明不兼容性以及需要手动入队的要求。

由索引模型根据 Issue 内容生成。

描述

Summary

gh stack link refuses a pull request that has auto-merge enabled, so adopting a stack costs a capability that an unstacked pull request keeps. Every layer then needs a person at the keyboard at the moment the layer below lands.

Evidence

Both pull requests approved and green. #101 had auto-merge enabled, so linking failed:

Checking existing stacks...
Looking up PRs for 2 branches...
✗ PR #101 cannot be added to a stack: it has auto-merge enabled

Turning auto-merge off let the link succeed.

This compounds the behaviour in #174. When the bottom layer merges, the layer above leaves the queue and GitHub rewrites its head, which restarts its required checks. Nothing puts it back. With auto-merge unavailable, only a person can, and only once the restarted checks finish. A stack of three with a 15-minute required check needs three waits and three manual enqueues to land one change.

Expected

A stacked pull request can use auto-merge, so each layer enqueues itself once its base merges and its checks pass.

If the two genuinely cannot coexist, say so where the user meets it: gh stack link should explain why auto-merge and stacks are exclusive, and the stack panel should say that each layer needs a manual enqueue.

Actual

gh stack link rejects the pull request with no explanation of the conflict, and offers no alternative.

Environment

  • gh 2.100.0, gh stack v0.0.8
  • Trunk protected by a merge queue, merge_method: REBASE
  • Two-layer stack, both pull requests approved with required checks passing

Reproduction

  1. Open two pull requests that stack on each other, both approved and green.
  2. Enable auto-merge on the bottom one.
  3. Run gh stack link <bottom> <top>.

Note on scope

This reports only what was observed: gh stack link rejects a pull request that already has auto-merge enabled. The reverse direction, enabling auto-merge on a pull request that is already stacked, was not tested, because the repository in question has allow_auto_merge: false set at the repository level for unrelated reasons.

Related

  • #174 — the layer above leaves the queue and is not put back, which is what makes the missing auto-merge costly
  • #172 — "'Merge stack' appears to enqueue only the bottom PR"
  • #502 — the merge queue rewrites a commit that needed no rewrite, which is what restarts the checks
  • #503 — the panel gives no sign that a manual enqueue is needed
主要语言
Go
星标
1.5k
派生
73
平均合并
1 天 8 小时
30 天内合并 PR
7

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/gh-stack 的其他 Issue

查看 github/gh-stack 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。