Skip to content

Commit

Permalink
bugfix: 遇到停止/取消等行为直接结束未启动的stage,不进行依赖判断 #11313
Browse files Browse the repository at this point in the history
  • Loading branch information
yongyiduan committed Dec 12, 2024
1 parent bfd270f commit 851c724
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ class CheckConditionalSkipStageCmd constructor(

override fun execute(commandContext: StageContext) {
val stage = commandContext.stage
val event = commandContext.event
// 遇到停止/取消等行为直接结束,因为本Stage还未进入
if (event.actionType.isEnd() && commandContext.buildStatus.isReadyToRun()) {
commandContext.buildStatus = BuildStatus.CANCELED
commandContext.cmdFlowState = CmdFlowState.FINALLY
LOG.info("ENGINE|${event.buildId}|${event.source}|STAGE_CANCEL|${event.stageId}")
return
}
// 仅在初次进入Stage时进行跳过和依赖判断
try {
if (checkIfSkip(commandContext)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ class CheckPauseReviewStageCmd(
val event = commandContext.event

// 处于等待中,遇到停止/取消等行为直接结束,因为本Stage还未进入
if (event.actionType.isEnd() &&
(commandContext.buildStatus.isPause() || commandContext.buildStatus.isReadyToRun())
) {
if (event.actionType.isEnd() && commandContext.buildStatus.isPause()) {
commandContext.buildStatus = BuildStatus.CANCELED
commandContext.cmdFlowState = CmdFlowState.FINALLY
LOG.info("ENGINE|${event.buildId}|${event.source}|STAGE_CANCEL|${event.stageId}")
Expand Down

0 comments on commit 851c724

Please sign in to comment.