feat(ai-review 對話收斂): 讀 PR review 留言判斷解決狀態並收斂 findings #42
+4
-3
@@ -109,8 +109,9 @@ function toReviewComment(f) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 發布單一 Gitea review:
|
* 發布單一 Gitea review:
|
||||||
* - summaryFindings 只用來統計本文數字
|
* - summaryFindings 只用來統計本文數字(含新舊問題)
|
||||||
* - commentFindings 用來產生 review comments,並依嚴重等級排序
|
* - commentFindings 用來產生 review comments,並依嚴重等級排序;
|
||||||
|
* 只為新問題加上行內標註,舊問題(is_new === false)僅計入統計、不再重複標註檔案與行數
|
||||||
*/
|
*/
|
||||||
export async function postFindingsReview(findings, deps = {}) {
|
export async function postFindingsReview(findings, deps = {}) {
|
||||||
const {
|
const {
|
||||||
@@ -120,7 +121,7 @@ export async function postFindingsReview(findings, deps = {}) {
|
|||||||
usageSection = '',
|
usageSection = '',
|
||||||
} = deps;
|
} = deps;
|
||||||
const sortedComments = [...commentFindings].sort(bySeverity);
|
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);
|
const body = buildReviewSummary(summaryFindings, usageSection);
|
||||||
await postReview({ body, comments });
|
await postReview({ body, comments });
|
||||||
ok(`review 發布: summary=${summaryFindings.length} total=${sortedComments.length} commentable=${comments.length}`);
|
ok(`review 發布: summary=${summaryFindings.length} total=${sortedComments.length} commentable=${comments.length}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user