Skip to content

Commit

Permalink
feat:推荐版本号优化 #10958 推荐版本号返回上次构建值
Browse files Browse the repository at this point in the history
  • Loading branch information
royalhuang committed Sep 20, 2024
1 parent dad4e00 commit 99e6e9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ class PipelineRepositoryVersionService(
val pipelineVersionLock = PipelineVersionLock(redisOperation, pipelineId, version)
try {
pipelineVersionLock.lock()
val count = pipelineBuildDao.countBuildNumByVersion(
dslContext = dslContext,
projectId = projectId,
pipelineId = pipelineId,
version = version
)
if (count > 0) {
throw ErrorCodeException(
errorCode = ProcessMessageCode.ERROR_PIPELINE_CAN_NOT_DELETE_WHEN_HAVE_BUILD_RECORD
)
}
// val count = pipelineBuildDao.countBuildNumByVersion(
// dslContext = dslContext,
// projectId = projectId,
// pipelineId = pipelineId,
// version = version
// )
// if (count > 0) {
// throw ErrorCodeException(
// errorCode = ProcessMessageCode.ERROR_PIPELINE_CAN_NOT_DELETE_WHEN_HAVE_BUILD_RECORD
// )
// }
dslContext.transaction { t ->
val transactionContext = DSL.using(t)
// #8161 软删除数据,前端无法查询到该版本
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class PipelineBuildFacadeService(
param.value = if (param.constant == true) {
param.readOnly = true
param.defaultValue
} else if (!param.required || !recommendVersionKey(param.id)) {
} else if (!param.required && !recommendVersionKey(param.id)) {
param.defaultValue
} else if (param.defaultValue is Boolean) {
realValue?.toString()?.toBoolean()
Expand Down

0 comments on commit 99e6e9c

Please sign in to comment.