bug: fallback follow-up PR 正文保留 Closes 关键字,合并时会误关 issue

Open Beginner friendly
#372 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github, python
Domain
backend, devtools

Research direction

Start with .github/scripts/apply_pr_comment_result.py:77 and trace how metadata["pr_summary"] is used for new and updated follow-up PRs. Read test_apply_pr_comment_result.py and validate_pr_body.py:73-77 to understand existing coverage and validation; add coverage for closing references such as Closes #N in this fallback path. Done means follow-up PRs no longer auto-close the issue, with tests covering both creation and update.

Written by the indexing model from the issue text.

Description

area:tests area:workflow bug repro:high triaged

问题位置

.github/scripts/apply_pr_comment_result.py:77

触发条件

branch_strategy 为 fallback-pr-to-fork,且实现代理输出的 pr_summary 含有 Closes #、Fixes # 等 closing reference,例如沿用 implement-issue skill 的首行 Closes 模板或复制原 PR 的关闭引用。

实际影响

创建或更新 follow-up PR 时该 closing keyword 会原样进入 PR 正文;follow-up PR 合并到其 base/default 分支后,GitHub 会提前或错误关闭对应 issue,而原 PR 可能仍未合并。

核实依据

apply_pr_comment_result.py 第 75 行更新已有 PR、第 77 行设置新 PR 正文时都直接使用 metadata["pr_summary"],第 78-79 行只决定是否补 Follow-up 行,既不拒绝也不中和 closing keyword。validate_pr_body.py 第 73-77 行只校验 Summary/Testing/Risk/How to revert 章节,因此含 Closes #N 的 metadata 可通过校验。implement-issue/SKILL.md 第 121-122 行要求首行写 Closes #<issue_number>,而 specs/issue-28/tech.md 第 198 行明确 fallback follow-up PR 不应 auto-close unrelated issue。现有 test_apply_pr_comment_result.py 未覆盖 closing reference;#371 报告的是 update-dedupe 的同类问题,但未覆盖本调用路径。

扫描提交:e777f60106e401b086925270af317a4b36722be0;扫描日期:2026-11-26(北京时间);轮巡分片:56/90。

Dominant language
Python
Stars
171
Forks
24
Avg merge
3h 13m
Merged PRs (30d)
13

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Terry-Mao/AICodingFlow

All issues in Terry-Mao/AICodingFlow

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.