Stack panel says a pull request is queued when it has no queue entry

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

还没有人认领这个 Issue。

评估

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

调研方向

先查看 stack 面板状态以及 pullRequest 查询字段 isInMergeQueue 和 mergeQueueEntry{ position };通过将面板与合并队列页面和 API 响应进行比较,重现两个 PR 的情况。完成标准是:未入队的上方 pull request 不再显示入队相关文案或 Remove from queue 操作,而现有的正确徽章仍保持正确。

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

描述

Summary

On a stacked pull request that is not in the merge queue, the stack panel says it is, and offers to remove it. The badges in the same panel report the state correctly, so the panel contradicts itself.

Evidence

Stack main ← #101 ← #102. After Enqueue stack (2), only #101 is admitted. The page of #102 then shows:

  • the heading "Queued to merge…"
  • "This pull request is next up in the merge queue."
  • a "Remove from queue" button
  • badges #102 Ready and #101 Queued, which are correct
Image

The merge queue page for the same branch shows 1 Queued and lists only #101:

Image

The API agrees with the queue page, not with the heading:

mergeQueue(branch:"main").entries.totalCount = 1
mergeQueue(branch:"main").entries.nodes      = [{ position: 1, pullRequest: #101 }]

#101   isInMergeQueue true    position 1
#102   isInMergeQueue false   mergeQueueEntry null

#102 reported isInMergeQueue=false at every sample across the whole landing.

Expected

A stacked pull request with no queue entry should not be described as queued:

  • do not head the panel "Queued to merge…" on a pull request that is not queued;
  • do not say "This pull request is next up in the merge queue" when isInMergeQueue is false. If the intent is that this layer goes after the one below it, say that. It is a statement about the stack, not about queue membership;
  • do not offer "Remove from queue" for a pull request with no mergeQueueEntry. The button does not say whether it would remove the layer below, which would be destructive.

Actual

The heading, the sentence and the button all claim queue membership that the API denies, while the badges in the same panel report it correctly.

Environment

  • gh 2.100.0, gh stack v0.0.8
  • Trunk ruleset:
    merge_queue:   grouping_strategy HEADGREEN, merge_method REBASE,
                   max_entries_to_build 8, max_entries_to_merge 8,
                   min_entries_to_merge 1, min_entries_to_merge_wait_minutes 5,
                   check_response_timeout_minutes 40
    pull_request:  allowed_merge_methods ["rebase"], required_approving_review_count 1,
                   require_last_push_approval false, dismiss_stale_reviews_on_push false
    
  • delete_branch_on_merge: true, allow_auto_merge: false

Reproduction

  1. Protect a trunk with a merge queue. Run gh stack link <bottom> <top> and get both pull requests approved and green.
  2. Press Enqueue stack (2).
  3. Open the top pull request and compare its panel against the branch's merge queue page and against pullRequest{ isInMergeQueue mergeQueueEntry{ position } }.

Related

  • #174 — why the upper layer is out of the queue in the first place
  • #172 — "'Merge stack' appears to enqueue only the bottom PR"
  • #502 — the wording matters most there, because the rewrite forces a manual re-enqueue and this panel gives no sign of it
主要语言
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 摘要。