From f170c36fc815efb05abc3d3b7d36d8b7da469707 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Tue, 23 Jun 2026 13:51:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(ai-review=20comment):=20=E8=A1=8C=E5=85=A7?= =?UTF-8?q?=20comment=20=E5=8F=AA=E6=A8=99=E8=A8=BB=E6=96=B0=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=EF=BC=8C=E8=88=8A=E5=95=8F=E9=A1=8C=E5=83=85=E8=A8=88?= =?UTF-8?q?=E5=85=A5=E7=B5=B1=E8=A8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/comments.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/comments.js b/app/comments.js index da84924..a6acfe2 100644 --- a/app/comments.js +++ b/app/comments.js @@ -109,8 +109,9 @@ function toReviewComment(f) { /** * 發布單一 Gitea review: - * - summaryFindings 只用來統計本文數字 - * - commentFindings 用來產生 review comments,並依嚴重等級排序 + * - summaryFindings 只用來統計本文數字(含新舊問題) + * - commentFindings 用來產生 review comments,並依嚴重等級排序; + * 只為新問題加上行內標註,舊問題(is_new === false)僅計入統計、不再重複標註檔案與行數 */ export async function postFindingsReview(findings, deps = {}) { const { @@ -120,7 +121,7 @@ export async function postFindingsReview(findings, deps = {}) { usageSection = '', } = deps; const sortedComments = [...commentFindings].sort(bySeverity); - const comments = sortedComments.map(toReviewComment).filter(Boolean); + const comments = sortedComments.filter(f => f.is_new !== false).map(toReviewComment).filter(Boolean); const body = buildReviewSummary(summaryFindings, usageSection); await postReview({ body, comments }); ok(`review 發布: summary=${summaryFindings.length} total=${sortedComments.length} commentable=${comments.length}`);