fix(comments review): 送出前排序 Review comments
AI / 計算版本號 (pull_request) Successful in 2s
AI / Code Review (pull_request) Failing after 1m1s

This commit is contained in:
2026-06-22 16:24:55 +00:00
parent 47b5b7ea5c
commit 297e75cdd5
2 changed files with 23 additions and 3 deletions
+7 -3
View File
@@ -94,11 +94,15 @@ export async function postFindingsReview(findings, deps = {}) {
summaryFindings = findings,
commentFindings = findings,
} = deps;
const sortedComments = [...commentFindings].sort(bySeverity);
const comments = sortedComments.map(toReviewComment).filter(Boolean);
const commentItems = commentFindings
.map(finding => ({ finding, comment: toReviewComment(finding) }))
.filter(item => item.comment);
const comments = commentItems
.sort((a, b) => bySeverity(a.finding, b.finding))
.map(item => item.comment);
const body = buildReviewSummary(summaryFindings);
await postReview({ body, comments });
ok(`review 發布: summary=${summaryFindings.length} total=${sortedComments.length} commentable=${comments.length}`);
ok(`review 發布: summary=${summaryFindings.length} total=${commentFindings.length} commentable=${comments.length}`);
}
/**