Skip to content

Commit

Permalink
feat:支持针对构建重放事件 #11232
Browse files Browse the repository at this point in the history
  • Loading branch information
hejieehe committed Dec 30, 2024
1 parent ef956d6 commit e30ec0e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,13 +641,14 @@ class UserBuildResourceImpl @Autowired constructor(
pipelineId: String,
buildId: String
): Result<BuildId> {
val buildId = pipelineBuildFacadeService.replayBuild(
projectId = projectId,
pipelineId = pipelineId,
buildId = buildId,
userId = userId
return Result(
pipelineBuildFacadeService.replayBuild(
projectId = projectId,
pipelineId = pipelineId,
buildId = buildId,
userId = userId
)
)
return Result(buildId)
}

private fun checkParam(userId: String, projectId: String, pipelineId: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2713,19 +2713,21 @@ class PipelineBuildFacadeService(
val startType = StartType.toStartType(buildInfo.trigger)
// 非webhook触发
if (startType != StartType.WEB_HOOK) throw ErrorCodeException(
errorCode = ProcessMessageCode
errorCode = ProcessMessageCode.ERROR_NOT_FOUND_TRIGGER_EVENT
)
webhookBuildParameterService.getBuildParameters(buildId = buildInfo.buildId)?.forEach { param ->
startParameters[param.key] = param.value.toString()
}
webhookTriggerPipelineBuild(
userId = buildInfo.startUser,
projectId = projectId,
pipelineId = pipelineId,
parameters = startParameters,
checkPermission = false,
startType = startType
)!!
return BuildId(
webhookTriggerPipelineBuild(
userId = buildInfo.startUser,
projectId = projectId,
pipelineId = pipelineId,
parameters = startParameters,
checkPermission = false,
startType = startType
)!!
)
}

private fun buildRestartPipeline(
Expand Down
2 changes: 1 addition & 1 deletion support-files/i18n/process/message_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
2101254=Parameter {0} is required and cannot be empty
2101255=Start the build machine repeatedly. The current status of the build machine is: {0}
2101256=pipeline build parameter {0} value exceeds 4000 length limit

2101260=Replay failed, trigger event does not exist
ATOM_POST_EXECUTE_TIP=###Tip:this is the post-action hooked by [step{0}]{1}###
# 公共变量
ci.build-no=Build number. Only available when the recommended version number is enabled.
Expand Down
1 change: 1 addition & 0 deletions support-files/i18n/process/message_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
2101254=构建入参[{0}]必填,不能为空
2101255=重复启动构建机,当前构建机的状态为:{0}
2101256=流水线变量{0}值超出4000长度限制
2101260=回放失败,触发事件不存在
ATOM_POST_EXECUTE_TIP=###Tip:this is the post-action hooked by [step{0}]{1}###
ci.build-no=构建号,开启推荐版本号时有效
Expand Down

0 comments on commit e30ec0e

Please sign in to comment.