poteto-mode watch-pr: PRs that are BLOCKED, BEHIND, UNKNOWN or REVIEW_REQUIRED come back as ready with mergeability "clear"
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github, typescript
- 领域
- tooling
调研方向
从 scripts/watch-pr/policy.ts 开始:阅读第 12 行的 assessGitHubMerge、第 167 行的 gateReason 和第 203 行的 readyContribution,然后运行 policy.test.ts(第 42 行编码了当前行为)。使用 watch-pr/fakes.test-helper.ts 复现 BLOCKED/BEHIND/UNKNOWN/REVIEW_REQUIRED 这些情况。完成意味着真值表测试预期这些状态会得到 gate 或等待结果,并且不再为它们返回 mergeability: "clear"。
由索引模型根据 Issue 内容生成。
描述
Found against pstack 0.15.34 at cursor/plugins 519d36aa98955bf680db01bcde5fdfba686dc901 (harness/pstack/claude-code/skills/poteto-mode/). Line numbers refer to that commit.
scripts/watch-pr/policy.ts decides readiness from CI and review threads, but not from GitHub's merge state or the
required review:
assessGitHubMerge(policy.ts:12): whenmergeStateStatusisBLOCKED, the only refusal is a head rollup of
ERRORorFAILURE. ASUCCESSrollup returnskind: "allowed",basis: "rollup".BEHIND,UNKNOWNand every
other state fall through toallowed,basis: "merge-state"(:26).gateReason(:167) turns onlyCHANGES_REQUESTEDinto a gate.REVIEW_REQUIREDis not a gate.readyContribution(:203) then returnskind: "ready-pr"withproof.mergeability: "clear".
GitHub documents BLOCKED as "the merge is blocked" and REVIEW_REQUIRED as "a review is required before the pull
request can be merged" (schema,
review decision). This also contradicts
playbooks/babysit.md:12, which requires the forge to agree that the PR can merge. GitHub still enforces its own rules,
but the watcher reports false readiness, so a babysit, shipping or autopilot run tells the user that a PR is mergeable
when it isn't.
Repro: call readSnapshot then classifyPr with the shipped fake reader (watch-pr/fakes.test-helper.ts), using
passing CI, rollup SUCCESS, no threads, reviewDecision: "REVIEW_REQUIRED", and each merge state:
mergeStateStatus BLOCKED -> kind: ready, mergeability: clear
mergeStateStatus BEHIND -> kind: ready, mergeability: clear
mergeStateStatus UNKNOWN -> kind: ready, mergeability: clear
The 18 existing tests in policy.test.ts pass. policy.test.ts:42 asserts the current behavior.
Suggested fix:
- Make an outstanding required review (
REVIEW_REQUIRED) and aBLOCKEDmerge state into merge gates (merge-gate
blockers with their own reasons), whatever the rollup says. - Treat
UNKNOWN(GitHub is still computing it) as waiting, not ready. TreatBEHINDas a gate, or as waiting when the
repo doesn't require branches to be up to date. - Never emit
mergeability: "clear"unlessmergeStateStatusisCLEAN(orHAS_HOOKS/UNSTABLE, if those are
deliberately accepted). - Update the truth-table tests to assert gate or waiting outcomes for each of these states.
- 主要语言
- TypeScript
- 星标
- 13.9k
- 派生
- 1.4k
- 平均合并
- 6 小时 46 分钟
- 30 天内合并 PR
- 156
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cursor/plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 1 天内回复
-
statechart: a relative TLA2TOOLS or JAVA path fails, because TLC runs in the snapshot folder可能已有人在做 @Ehsan-hash 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
CopilotKit/openmuse#215 ·
维护者通常 3 天内回复
-
b:minor bug
难度 2/5 1-3 小时 新手友好度 76/100
software-mansion/argent#1698 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 条评论 ·
维护者通常 1 天内回复