Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:流水线版本管理机制 #8161 setting表版本号解绑 优化 #11223

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ 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
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
Expand Down Expand Up @@ -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 = pipelineId,
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)
Expand Down
Loading