Skip to content

fix(triage): 防止误改含 marker 的用户评论 - #345

Merged
Terry-Mao merged 1 commit into
mainfrom
fix/triage-comment-author-344
Nov 5, 2026
Merged

Terry-Mao merged 1 commit into
mainfrom
fix/triage-comment-author-344

Conversation

@Terry-Mao

Copy link
Copy Markdown
Owner

Summary

  • 仅将由 github-actions[bot] 发布、且以 triage marker 开头的评论视为可更新的分诊评论,避免覆盖用户评论。
  • 夜间扫描复用相同判定,防止用户粘贴 marker 后误跳过分诊。
  • 补充用户评论、其他 bot 评论、正文引用 marker 和新建评论的回归测试。

Fixes #344

Testing

  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m unittest discover -s .github/aicodingflow-tests:542 项通过。
  • git diff --check:通过。

Risk

  • 如果今后改用其他身份发布分诊评论,需要同步调整允许的评论作者;否则会新建评论,而不会更新该身份的旧评论。

How to revert

  • 回滚提交 49c5307,恢复原有评论匹配逻辑。

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查结论:通过。变更将分诊评论识别收敛为 is_triage_comment,同时校验评论作者为 github-actions[bot] 且正文以 triage marker 开头;夜间扫描复用同一判定,可避免用户或其他 bot 粘贴 marker 时误更新评论或误跳过分诊。新增测试覆盖用户评论、其他 bot 评论、正文引用 marker、已有 bot 评论及夜间扫描场景。未发现阻断性的正确性、安全或维护性问题;针对性测试 test_apply_issue_triage_result.py 8 项与 test_nightly_existing_code_review.py 19 项均通过。

@Terry-Mao
Terry-Mao merged commit 4582ba0 into main Nov 5, 2026
5 checks passed
@Terry-Mao
Terry-Mao deleted the fix/triage-comment-author-344 branch November 5, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: triage 评论回写会把含 marker 的用户评论当成 bot 评论

1 participant