bug: suggestion 闭合校验只统计全部围栏,未闭合建议块仍被接受

Open Beginner friendly
#368 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
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
ci-cd

Research direction

Start at .github/scripts/validate_review_json.py lines 107-116, where the suggestion opener is detected and closing is decided by a global body.count("```") < 2. Read test_validate_review_json.py to see how bodies are fed in, then add a case with a closed code block followed by an unclosed suggestion opener. Done means that body is rejected and the existing tests still pass.

Written by the indexing model from the issue text.

Description

area:tests area:workflow bug repro:high triaged

问题位置

.github/scripts/validate_review_json.py:115

触发条件

评论正文先包含一个普通已闭合代码块,随后打开 ```suggestion 但忘记闭合;NIT 或 SUGGESTION 正文都可触发。

实际影响

前面的普通代码块已经贡献两个三反引号,body.count("```") 因而通过;发布后 GitHub 会把 suggestion 当作未闭合的普通围栏,用户看不到可应用的修复建议,依赖建议块的审查意见失效。

核实依据

第 107-116 行只检查正文中出现过一次 suggestion opener,再用全局 body.count("```") < 2 判断闭合,没有确认 opener 之后存在独立的闭合围栏。现有 test_validate_review_json.py 未覆盖“先有代码块再有无闭合 suggestion”的组合。

扫描提交:e777f60106e401b086925270af317a4b36722be0;扫描日期:2026-11-23(北京时间);轮巡分片:53/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.