Skip to content

Commit

Permalink
pref:带矩阵的流水线运行矩阵分裂前的task任务无需写入记录表 TencentBlueKing#10873
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Aug 27, 2024
1 parent 40f5a51 commit 0d03beb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ data class BuildRecordContainer(
timestamps = mapOf()
)
)
if (taskBuildRecords == null) return
if (taskBuildRecords == null || container.matrixGroupFlag == true) return
container.elements.forEachIndexed { index, element ->
if (buildStatus == BuildStatus.SKIP && !ElementUtils.getTaskAddFlag(
element = element,
stageEnableFlag = stageEnableFlag,
containerEnableFlag = container.isContainerEnable(),
originMatrixContainerFlag = container.fetchGroupContainers() != null
originMatrixContainerFlag = container.matrixGroupFlag == true
)
) {
// 不保存跳过的非post任务记录或非质量红线记录
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ import com.tencent.devops.common.pipeline.pojo.element.Element
import com.tencent.devops.common.pipeline.pojo.element.market.MarketBuildAtomElement
import com.tencent.devops.common.pipeline.pojo.element.market.MarketBuildLessAtomElement
import com.tencent.devops.common.pipeline.pojo.element.matrix.MatrixStatusElement
import com.tencent.devops.common.pipeline.utils.ModelUtils
import com.tencent.devops.common.pipeline.utils.ElementUtils
import com.tencent.devops.common.pipeline.utils.ModelUtils
import com.tencent.devops.common.redis.RedisOperation
import com.tencent.devops.common.web.utils.I18nUtil
import com.tencent.devops.process.constant.ProcessMessageCode.BK_MANUALLY_SKIPPED
Expand All @@ -72,11 +72,11 @@ import com.tencent.devops.process.pojo.pipeline.record.BuildRecordStage
import com.tencent.devops.process.pojo.pipeline.record.BuildRecordTask
import com.tencent.devops.process.utils.BUILD_NO
import com.tencent.devops.process.utils.PIPELINE_NAME
import java.time.LocalDateTime
import org.jooq.DSLContext
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import java.time.LocalDateTime

/**
* 流水线Container相关的服务
Expand Down Expand Up @@ -330,7 +330,7 @@ class PipelineContainerService @Autowired constructor(
element = atomElement,
stageEnableFlag = stage.isStageEnable(),
containerEnableFlag = container.isContainerEnable(),
originMatrixContainerFlag = ContainerUtils.isOriginMatrixContainer(container)
originMatrixContainerFlag = container.matrixGroupFlag == true
)
) {
val taskVar = atomElement.initTaskVar()
Expand Down Expand Up @@ -453,7 +453,7 @@ class PipelineContainerService @Autowired constructor(
element = atomElement,
stageEnableFlag = stage.isStageEnable(),
containerEnableFlag = container.isContainerEnable(),
originMatrixContainerFlag = ContainerUtils.isOriginMatrixContainer(container)
originMatrixContainerFlag = container.matrixGroupFlag == true
)
) {
taskBuildRecords.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class PipelineRecordModelService @Autowired constructor(
containerVarMap[Container::status.name] = recordContainer.status ?: ""
containerVarMap[Container::executeCount.name] = recordContainer.executeCount
containerVarMap[Container::containPostTaskFlag.name] = recordContainer.containPostTaskFlag ?: false
containerVarMap[Container::matrixGroupFlag.name] = recordContainer.matrixGroupFlag ?: false
return containerVarMap
}

Expand Down

0 comments on commit 0d03beb

Please sign in to comment.