Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

poteto-mode watch-pr: PRs that are BLOCKED, BEHIND, UNKNOWN or REVIEW_REQUIRED come back as ready with mergeability "clear"

未关闭 适合新手
#1,053 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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): when mergeStateStatus is BLOCKED, the only refusal is a head rollup of
    ERROR or FAILURE. A SUCCESS rollup returns kind: "allowed", basis: "rollup". BEHIND, UNKNOWN and every
    other state fall through to allowed, basis: "merge-state" (:26).
  • gateReason (:167) turns only CHANGES_REQUESTED into a gate. REVIEW_REQUIRED is not a gate.
  • readyContribution (:203) then returns kind: "ready-pr" with proof.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 a BLOCKED merge 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. Treat BEHIND as a gate, or as waiting when the
    repo doesn't require branches to be up to date.
  • Never emit mergeability: "clear" unless mergeStateStatus is CLEAN (or HAS_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,通用步骤见我们的新手贡献指南。

从这里开始

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

cursor/plugins 的其他 Issue

查看 cursor/plugins 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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