From 7938f4dcaddf987abd1cffccee379c6c94e0f1c9 Mon Sep 17 00:00:00 2001 From: YXC0915 Date: Wed, 2 Dec 2026 19:21:55 +0800 Subject: [PATCH] ci: limit PR reviews to evidenced material findings --- .github/scripts/pr-review-language.mjs | 4 +- .github/scripts/pr-review.mjs | 68 ++++++++++++++++---------- .github/scripts/pr-review.test.mjs | 51 +++++++++++++++++-- docs/pr-review-guidelines.md | 6 ++- 4 files changed, 97 insertions(+), 32 deletions(-) diff --git a/.github/scripts/pr-review-language.mjs b/.github/scripts/pr-review-language.mjs index 46df7c4..7fe990d 100644 --- a/.github/scripts/pr-review-language.mjs +++ b/.github/scripts/pr-review-language.mjs @@ -24,10 +24,10 @@ export const english = { conflict: "GitHub detected merge conflicts. Resolve them and request another review.", mainMoved: "The default branch moved during review. Review against the new commit.", ciRequired: "Wait for passing CI and evidence of key tests.", + fixFindings: "Address the actionable findings below before merging.", pendingRequired: "Run the key checks listed above.", incomplete: "Review the remaining changes before merging.", inline: "Inline findings", - unlocated: "Findings could not be anchored to a reviewed line.", noFindings: "No actionable issues found in the reviewed changes.", noDiff: "No text diff was available to review.", inlineFallback: "GitHub could not attach inline comments. See the findings below.", @@ -59,10 +59,10 @@ export const chinese = { conflict: "GitHub 检测到合并冲突,解决后重新审核。", mainMoved: "主线已更新,请对照新的主线提交重新审核。", ciRequired: "等待对应提交的 CI 和关键测试记录。", + fixFindings: "合并前处理下方有证据的实质问题。", pendingRequired: "完成上面列出的关键流程实测。", incomplete: "本次只覆盖部分差异,合并前补齐审查。", inline: "行内问题", - unlocated: "审核建议未能定位到已审核的改动行。", noFindings: "已审核的差异中未发现可报告的问题。", noDiff: "没有可审核的文本差异。", inlineFallback: "GitHub 未能附加行内评论,审核意见如下。", diff --git a/.github/scripts/pr-review.mjs b/.github/scripts/pr-review.mjs index 507e0e0..6eabb73 100644 --- a/.github/scripts/pr-review.mjs +++ b/.github/scripts/pr-review.mjs @@ -10,7 +10,7 @@ const MAX_DIFF_LENGTH = 400_000; const MAX_FILE_LENGTH = 36_000; const CI_WAIT_MS = 240_000; const CI_APPEAR_WAIT_MS = 60_000; -const MAX_FINDINGS = 5; +const MAX_FINDINGS = 3; const MAX_PENDING_CHECKS = 3; const MAX_PREVIOUS_COMMENTS = 8; const MARKER_PREFIX = "