diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/UserBuildResourceImpl.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/UserBuildResourceImpl.kt index 062f0c6346d..5f8e6907890 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/UserBuildResourceImpl.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/UserBuildResourceImpl.kt @@ -641,13 +641,14 @@ class UserBuildResourceImpl @Autowired constructor( pipelineId: String, buildId: String ): Result { - 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) { diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/builds/PipelineBuildFacadeService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/builds/PipelineBuildFacadeService.kt index 5446064db9c..e78a17efc36 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/builds/PipelineBuildFacadeService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/builds/PipelineBuildFacadeService.kt @@ -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( diff --git a/support-files/i18n/process/message_en_US.properties b/support-files/i18n/process/message_en_US.properties index ec2298e4ab7..aa9f37d9ea9 100644 --- a/support-files/i18n/process/message_en_US.properties +++ b/support-files/i18n/process/message_en_US.properties @@ -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. diff --git a/support-files/i18n/process/message_zh_CN.properties b/support-files/i18n/process/message_zh_CN.properties index 643e85bda27..495c5ee3ea7 100644 --- a/support-files/i18n/process/message_zh_CN.properties +++ b/support-files/i18n/process/message_zh_CN.properties @@ -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=构建号,开启推荐版本号时有效