Skip to content

Commit

Permalink
feat: stage支持质量红线的准入准出 TencentBlueKing#4732 整体失败
Browse files Browse the repository at this point in the history
  • Loading branch information
royalhuang committed Aug 20, 2021
1 parent 5a7b12b commit 3677c25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class CheckPauseReviewStageCmd(
variables: Map<String, String>
): Boolean {
if (stage.checkIn?.ruleIds.isNullOrEmpty()) return false
try {
return try {
val request = BuildCheckParamsV3(
projectId = event.projectId,
pipelineId = event.pipelineId,
Expand All @@ -149,10 +149,10 @@ class CheckPauseReviewStageCmd(
LOG.info("ENGINE|${event.buildId}|${event.source}|STAGE_QUALITY_CHECK_RESPONSE|${event.stageId}|" +
"response=$result|ruleIds=${stage.checkIn?.ruleIds}")
stage.checkIn!!.checkTimes = result.checkTimes
return !result.success
!result.success
} catch (ignore: Throwable) {
LOG.error("ENGINE|${event.buildId}|${event.source}|STAGE_QUALITY_CHECK_ERROR|${event.stageId}", ignore)
return true
true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class UpdateStateForStageCmdFinally(
pipelineStageService.skipStage(userId = event.userId, buildStage = stage)
} else if (commandContext.buildStatus == BuildStatus.QUALITY_CHECK_FAIL) {
pipelineStageService.checkQualityFailStage(userId = event.userId, buildStage = stage)
// #4732 如果存在红线准入准出失败则构建整体直接失败
commandContext.buildStatus = BuildStatus.FAILED
}
nextOrFinish(event, stage, commandContext)
sendStageEndCallBack(stage, event)
Expand Down

0 comments on commit 3677c25

Please sign in to comment.