From 3677c2521a9f5286957d6d69ba6c9deda2a74d6c Mon Sep 17 00:00:00 2001 From: royalhuang Date: Fri, 20 Aug 2021 12:33:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20stage=E6=94=AF=E6=8C=81=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E7=BA=A2=E7=BA=BF=E7=9A=84=E5=87=86=E5=85=A5=E5=87=86?= =?UTF-8?q?=E5=87=BA=20#4732=20=E6=95=B4=E4=BD=93=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../control/command/stage/impl/CheckPauseReviewStageCmd.kt | 6 +++--- .../command/stage/impl/UpdateStateForStageCmdFinally.kt | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/CheckPauseReviewStageCmd.kt b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/CheckPauseReviewStageCmd.kt index 16be8e61300..41e59cac001 100644 --- a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/CheckPauseReviewStageCmd.kt +++ b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/CheckPauseReviewStageCmd.kt @@ -132,7 +132,7 @@ class CheckPauseReviewStageCmd( variables: Map ): Boolean { if (stage.checkIn?.ruleIds.isNullOrEmpty()) return false - try { + return try { val request = BuildCheckParamsV3( projectId = event.projectId, pipelineId = event.pipelineId, @@ -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 } } diff --git a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/UpdateStateForStageCmdFinally.kt b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/UpdateStateForStageCmdFinally.kt index 28fd62c8e2d..8fab13594a8 100644 --- a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/UpdateStateForStageCmdFinally.kt +++ b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/command/stage/impl/UpdateStateForStageCmdFinally.kt @@ -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)