diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt index 52f521b9e5d..62cf83e126d 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/PipelineInfoFacadeService.kt @@ -103,13 +103,6 @@ import com.tencent.devops.process.template.service.TemplateService import com.tencent.devops.process.yaml.PipelineYamlFacadeService import com.tencent.devops.process.yaml.transfer.aspect.IPipelineTransferAspect import com.tencent.devops.store.api.template.ServiceTemplateResource -import org.jooq.DSLContext -import org.jooq.impl.DSL -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.beans.factory.annotation.Value -import org.springframework.dao.DuplicateKeyException -import org.springframework.stereotype.Service import java.net.URLEncoder import java.time.LocalDateTime import java.util.LinkedList @@ -117,6 +110,13 @@ import java.util.concurrent.TimeUnit import javax.ws.rs.core.MediaType import javax.ws.rs.core.Response import javax.ws.rs.core.StreamingOutput +import org.jooq.DSLContext +import org.jooq.impl.DSL +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.beans.factory.annotation.Value +import org.springframework.dao.DuplicateKeyException +import org.springframework.stereotype.Service @Suppress("ALL") @Service @@ -969,26 +969,14 @@ class PipelineInfoFacadeService @Autowired constructor( labels = pipelineCopy.labels ) modelCheckPlugin.clearUpModel(copyMode) - val newPipelineId = createPipeline(userId, projectId, copyMode, channelCode).pipelineId val settingInfo = pipelineSettingFacadeService.getSettingInfo(projectId, pipelineId) - if (settingInfo != null) { - // setting pipeline需替换成新流水线的 - val newSetting = pipelineSettingFacadeService.rebuildSetting( - oldSetting = settingInfo, - projectId = projectId, - newPipelineId = newPipelineId, - pipelineName = pipelineCopy.name - ) - // 复制setting到新流水线 - pipelineSettingFacadeService.saveSetting( - userId = userId, - projectId = projectId, - pipelineId = newPipelineId, - setting = newSetting, - dispatchPipelineUpdateEvent = false, - updateLabels = false - ) - } + val newPipelineId = createPipeline( + userId = userId, + projectId = projectId, + model = copyMode, + channelCode = channelCode, + setting = settingInfo + ).pipelineId return newPipelineId } catch (e: JsonParseException) { logger.error("Parse process($pipelineId) fail", e)