From f886c5494766f32586322ab87374668b5ac73338 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Wed, 14 Aug 2024 06:38:01 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BDRe?= =?UTF-8?q?view=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/manageMrEvent/index.ts | 32 ++++++++++++------------------ 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/controllers/manageMrEvent/index.ts b/controllers/manageMrEvent/index.ts index 162a7a5..c3d8b1f 100644 --- a/controllers/manageMrEvent/index.ts +++ b/controllers/manageMrEvent/index.ts @@ -3,7 +3,6 @@ import { Logger } from "winston" import service from "../../service" import netTool from "../../service/netTool" import { Gitlab } from "../../types/gitlab" -import reviewFiles from "./reviewFiles" import summaryFiles from "./summaryFiles" import summaryMr from "./summaryMr" import Commenter from "./utils/commenter" @@ -106,12 +105,7 @@ const manageRawEvent = async ( inputs.description = changes.description || "暂无描述" // 对文件进行总结 - const { summarizedFileMap, needReviewFileMap } = await summaryFiles( - files, - true, - inputs, - logger - ) + const { summarizedFileMap } = await summaryFiles(files, true, inputs, logger) // 如果总结完的文件Map为空,则不处理 if (summarizedFileMap.size === 0) { logger.info("No summarized files") @@ -130,18 +124,18 @@ const manageRawEvent = async ( inputs.shortSummary = summarizedMr // 发送总结评论 + 文件变更 await commenter.createSummarizedComment(summarizedMr, summarizedFileMap) - // 过滤出需要审查的文件 - const needReviewFiles = files.filter( - (file) => needReviewFileMap.get(file.new_path) || false - ) - // 如果需要审查的文件为空,则不处理 - if (needReviewFiles.length === 0) { - logger.info("No need review files") - await commenter.createComment("没有需要审查的文件") - return netTool.ok() - } - // 对需要审查的文件进行审查 - await reviewFiles(needReviewFiles, inputs, commenter, logger) + // // 过滤出需要审查的文件 + // const needReviewFiles = files.filter( + // (file) => needReviewFileMap.get(file.new_path) || false + // ) + // // 如果需要审查的文件为空,则不处理 + // if (needReviewFiles.length === 0) { + // logger.info("No need review files") + // await commenter.createComment("没有需要审查的文件") + // return netTool.ok() + // } + // // 对需要审查的文件进行审查 + // await reviewFiles(needReviewFiles, inputs, commenter, logger) return netTool.ok() }