fix(comments review): 送出前排序 Review comments
This commit is contained in:
+7
-3
@@ -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}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user