From e4444108c2c91e3310531aaadeecac97d075dd2e Mon Sep 17 00:00:00 2001 From: yjieliang Date: Mon, 6 Nov 2023 15:35:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B8=8C=E6=9C=9B=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=88=86=E6=94=AF=E8=BF=9B=E8=A1=8C=E4=B8=8A=E6=9E=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20#4780?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devops/store/pojo/atom/MarketAtomUpdateRequest.kt | 4 +++- .../devops/store/pojo/atom/UpdateAtomPackageInfo.kt | 4 +--- .../store/service/atom/impl/AtomReleaseServiceImpl.kt | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/MarketAtomUpdateRequest.kt b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/MarketAtomUpdateRequest.kt index 1cd7e6e1ad6..b15eb881091 100644 --- a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/MarketAtomUpdateRequest.kt +++ b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/MarketAtomUpdateRequest.kt @@ -74,5 +74,7 @@ data class MarketAtomUpdateRequest( @ApiModelProperty(value = "插件字段校验确认标识", required = false) val fieldCheckConfirmFlag: Boolean? = false, @ApiModelProperty("分支", required = false) - val branch: String? = null + val branch: String? = null, + @ApiModelProperty("是否属于分支测试版本", required = false) + var isBranchTestVersion: Boolean = false ) diff --git a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/UpdateAtomPackageInfo.kt b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/UpdateAtomPackageInfo.kt index c775f862e68..ead4559f600 100644 --- a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/UpdateAtomPackageInfo.kt +++ b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/UpdateAtomPackageInfo.kt @@ -40,7 +40,5 @@ data class UpdateAtomPackageInfo( @ApiModelProperty("包路径") val packagePath: String?, @ApiModelProperty("插件包资源类型") - val atomPackageSourceType: PackageSourceTypeEnum, - @ApiModelProperty("是否属于分支测试版本)") - val isBranchTestVersion: Boolean + val atomPackageSourceType: PackageSourceTypeEnum ) diff --git a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/service/atom/impl/AtomReleaseServiceImpl.kt b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/service/atom/impl/AtomReleaseServiceImpl.kt index 075971793bb..e4a6e04d6f5 100644 --- a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/service/atom/impl/AtomReleaseServiceImpl.kt +++ b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/service/atom/impl/AtomReleaseServiceImpl.kt @@ -421,7 +421,6 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ UUIDUtil.generate() } val newVersionFlag = !(releaseType == ReleaseTypeEnum.NEW || releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE) - return updateAtomVersionInfo( userId = userId, projectCode = projectCode, @@ -430,8 +429,7 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ atomId = if (newVersionFlag) atomId else newestAtomRecord.id, i18nDir = i18nDir, packagePath = executionInfoMap[KEY_PACKAGE_PATH] as? String, - atomPackageSourceType = atomPackageSourceType, - isBranchTestVersion = false + atomPackageSourceType = atomPackageSourceType ), convertUpdateRequest = convertUpdateRequest, getAtomConfResult = getAtomConfResult @@ -1287,7 +1285,7 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ ), version = version ) - if (!updateAtomPackageInfo.isBranchTestVersion) { + if (!convertUpdateRequest.isBranchTestVersion) { // 校验插件发布类型 marketAtomCommonService.validateReleaseType( atomId = atomRecord.id, @@ -1386,7 +1384,7 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ atomRecord = atomRecord ) } - if (!updateAtomPackageInfo.isBranchTestVersion && atomStatus == AtomStatusEnum.TESTING) { + if (!convertUpdateRequest.isBranchTestVersion && atomStatus == AtomStatusEnum.TESTING) { // 插件大版本内有测试版本则写入缓存 redisOperation.hset( key = "$ATOM_POST_VERSION_TEST_FLAG_KEY_PREFIX:$atomCode", @@ -1396,7 +1394,7 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ } // 更新标签信息 val labelIdList = convertUpdateRequest.labelIdList?.filter { !it.isNullOrBlank() } - if (!updateAtomPackageInfo.isBranchTestVersion && null != labelIdList) { + if (!convertUpdateRequest.isBranchTestVersion && null != labelIdList) { atomLabelRelDao.deleteByAtomId(context, atomId) if (labelIdList.isNotEmpty()) { atomLabelRelDao.batchAdd(context, userId = userId, atomId = atomId, labelIdList = labelIdList)