chore: 暂时屏蔽Review功能
All checks were successful
CI Monitor MIflow / build-image (push) Successful in 55s

This commit is contained in:
zhaoyingbo 2024-08-14 06:38:01 +00:00
parent 4c3acbb787
commit f886c54947

View File

@ -3,7 +3,6 @@ import { Logger } from "winston"
import service from "../../service" import service from "../../service"
import netTool from "../../service/netTool" import netTool from "../../service/netTool"
import { Gitlab } from "../../types/gitlab" import { Gitlab } from "../../types/gitlab"
import reviewFiles from "./reviewFiles"
import summaryFiles from "./summaryFiles" import summaryFiles from "./summaryFiles"
import summaryMr from "./summaryMr" import summaryMr from "./summaryMr"
import Commenter from "./utils/commenter" import Commenter from "./utils/commenter"
@ -106,12 +105,7 @@ const manageRawEvent = async (
inputs.description = changes.description || "暂无描述" inputs.description = changes.description || "暂无描述"
// 对文件进行总结 // 对文件进行总结
const { summarizedFileMap, needReviewFileMap } = await summaryFiles( const { summarizedFileMap } = await summaryFiles(files, true, inputs, logger)
files,
true,
inputs,
logger
)
// 如果总结完的文件Map为空则不处理 // 如果总结完的文件Map为空则不处理
if (summarizedFileMap.size === 0) { if (summarizedFileMap.size === 0) {
logger.info("No summarized files") logger.info("No summarized files")
@ -130,18 +124,18 @@ const manageRawEvent = async (
inputs.shortSummary = summarizedMr inputs.shortSummary = summarizedMr
// 发送总结评论 + 文件变更 // 发送总结评论 + 文件变更
await commenter.createSummarizedComment(summarizedMr, summarizedFileMap) await commenter.createSummarizedComment(summarizedMr, summarizedFileMap)
// 过滤出需要审查的文件 // // 过滤出需要审查的文件
const needReviewFiles = files.filter( // const needReviewFiles = files.filter(
(file) => needReviewFileMap.get(file.new_path) || false // (file) => needReviewFileMap.get(file.new_path) || false
) // )
// 如果需要审查的文件为空,则不处理 // // 如果需要审查的文件为空,则不处理
if (needReviewFiles.length === 0) { // if (needReviewFiles.length === 0) {
logger.info("No need review files") // logger.info("No need review files")
await commenter.createComment("没有需要审查的文件") // await commenter.createComment("没有需要审查的文件")
return netTool.ok() // return netTool.ok()
} // }
// 对需要审查的文件进行审查 // // 对需要审查的文件进行审查
await reviewFiles(needReviewFiles, inputs, commenter, logger) // await reviewFiles(needReviewFiles, inputs, commenter, logger)
return netTool.ok() return netTool.ok()
} }