Skip to content

Commit

Permalink
Merge pull request #11241 from royalhuang/issue_11186
Browse files Browse the repository at this point in the history
feat:推荐版本号模版优化 #11186
  • Loading branch information
bkci-bot authored Dec 6, 2024
2 parents 2ce2145 + a3a81a4 commit bf100ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ data class DeployPipelineResult(
val targetUrl: String? = null,
@get:Schema(title = "yaml信息", required = false)
val yamlInfo: PipelineYamlVo? = null,
@get:Schema(title = "是否更新了推荐版本号", required = false)
@get:Schema(title = "是否更新了推荐版本号基准值", required = false)
val updateBuildNo: Boolean? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ data class TemplateInstanceParams(
@get:Schema(title = "构建号,不建议使用", required = false)
val buildNo: BuildNo?,
@get:Schema(title = "流水线变量列表", required = false)
val param: List<BuildFormProperty>
val param: List<BuildFormProperty>,
@get:Schema(title = "是否更新了推荐版本号基准值", required = false)
val updateBuildNo: Boolean? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -1526,19 +1526,24 @@ class TemplateFacadeService @Autowired constructor(
logger.info("[$userId|$projectId|$templateId|$version] Get the param ($instanceParams)")

// 模板中的buildNo存在才需要回显
// 将实例自己维护的当前值一起返回
val instanceBuildNoObj = templateTriggerContainer.buildNo?.let { no ->
BuildNo(
buildNoType = no.buildNoType,
required = no.required ?: instanceTriggerContainer.buildNo?.required,
buildNo = buildNos[pipelineId] ?: no.buildNo
buildNo = no.buildNo,
currentBuildNo = buildNos[pipelineId]
)
}

pipelineId to TemplateInstanceParams(
pipelineId = pipelineId,
pipelineName = getPipelineName(settings, pipelineId) ?: templateModel.name,
buildNo = instanceBuildNoObj,
param = instanceParams
param = instanceParams,
updateBuildNo = instanceTriggerContainer.buildNo?.let { ino ->
ino.buildNo != templateModel.getTriggerContainer().buildNo?.buildNo
}
)
}.toMap()
} catch (ignored: Throwable) {
Expand Down

0 comments on commit bf100ab

Please sign in to comment.