From 3204fd267fffe30f1eb8f5d2ba765b54a786ae9d Mon Sep 17 00:00:00 2001 From: carlyin Date: Wed, 4 Dec 2024 15:27:35 +0800 Subject: [PATCH] =?UTF-8?q?pref=EF=BC=9A=E7=A0=94=E5=8F=91=E5=95=86?= =?UTF-8?q?=E5=BA=97=E9=80=9A=E7=94=A8=E5=8C=96=E6=8E=A5=E5=8F=A3=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E4=BC=98=E5=8C=96=20#11049?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/UserStoreComponentManageResourceImpl.kt | 2 +- .../common/service/impl/StoreBaseUpdateServiceImpl.kt | 11 +++++++++++ .../service/impl/StoreComponentQueryServiceImpl.kt | 3 +-- .../common/service/impl/StoreReleaseServiceImpl.kt | 2 +- .../tencent/devops/store/image/dao/MarketImageDao.kt | 1 - 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/resources/UserStoreComponentManageResourceImpl.kt b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/resources/UserStoreComponentManageResourceImpl.kt index 1a118e9b580..e9f02dc846e 100644 --- a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/resources/UserStoreComponentManageResourceImpl.kt +++ b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/resources/UserStoreComponentManageResourceImpl.kt @@ -105,7 +105,7 @@ class UserStoreComponentManageResourceImpl( storeCode: String, storeTestRequest: StoreTestRequest ): Result { - return Result( + return Result( storeProjectService.saveStoreTestInfo( userId = userId, storeType = storeType, diff --git a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreBaseUpdateServiceImpl.kt b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreBaseUpdateServiceImpl.kt index ced8bf506b4..41a8217a0cd 100644 --- a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreBaseUpdateServiceImpl.kt +++ b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreBaseUpdateServiceImpl.kt @@ -49,9 +49,11 @@ import com.tencent.devops.store.common.service.StoreCommonService import com.tencent.devops.store.common.service.StoreReleaseSpecBusService import com.tencent.devops.store.common.utils.StoreReleaseUtils import com.tencent.devops.store.common.utils.StoreUtils +import com.tencent.devops.store.constant.StoreMessageCode import com.tencent.devops.store.pojo.common.KEY_CLASSIFY_ID import com.tencent.devops.store.pojo.common.KEY_STORE_ID import com.tencent.devops.store.pojo.common.enums.ReleaseTypeEnum +import com.tencent.devops.store.pojo.common.enums.StoreStatusEnum import com.tencent.devops.store.pojo.common.enums.StoreTypeEnum import com.tencent.devops.store.pojo.common.publication.StoreBaseDataPO import com.tencent.devops.store.pojo.common.publication.StoreUpdateRequest @@ -94,6 +96,15 @@ class StoreBaseUpdateServiceImpl @Autowired constructor( val storeCode = storeBaseUpdateRequest.storeCode val name = storeBaseUpdateRequest.name val versionInfo = storeBaseUpdateRequest.versionInfo + val version = versionInfo.version + val baseRecord = storeBaseQueryDao.getComponent( + dslContext = dslContext, storeCode = storeCode, version = version, storeType = storeType + ) ?: throw ErrorCodeException( + errorCode = CommonMessageCode.PARAMETER_IS_INVALID, params = arrayOf("$storeCode:$version") + ) + if (StoreStatusEnum.INIT.name != baseRecord.status) { + throw ErrorCodeException(errorCode = StoreMessageCode.STORE_RELEASE_STEPS_ERROR) + } val classifyCode = storeBaseUpdateRequest.classifyCode // 校验分类信息是否准确 val classifyRecord = diff --git a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreComponentQueryServiceImpl.kt b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreComponentQueryServiceImpl.kt index 40d89024fd4..d29fde4fcc7 100644 --- a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreComponentQueryServiceImpl.kt +++ b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreComponentQueryServiceImpl.kt @@ -836,8 +836,7 @@ class StoreComponentQueryServiceImpl : StoreComponentQueryService { val installed = storeInfoQuery.installed installed?.let { // 根据是否安装条件筛选组件 - if ((installed && !installComponentMap.contains(storeCode)) || - (!installed && installComponentMap.contains(storeCode))) { + if (installed != installComponentMap.containsKey(storeCode)) { return@forEach } } diff --git a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreReleaseServiceImpl.kt b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreReleaseServiceImpl.kt index 303082d47a2..76069bbb562 100644 --- a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreReleaseServiceImpl.kt +++ b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreReleaseServiceImpl.kt @@ -505,7 +505,7 @@ class StoreReleaseServiceImpl @Autowired constructor( StoreReleaseSpecBusService::class.java, StoreUtils.getReleaseSpecBusServiceBeanName(storeType) ) val status = storeReleaseSpecBusService.getStoreRunPipelineStatus(startFlag = false) - val lock = RedisLock(redisOperation, "store:$storeId:rebuild", 30) + val lock = RedisLock(redisOperation, "store:$storeId:build", 30) try { lock.lock() status?.let { diff --git a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/image/dao/MarketImageDao.kt b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/image/dao/MarketImageDao.kt index b8ed66e7e4b..39cc3c08f70 100644 --- a/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/image/dao/MarketImageDao.kt +++ b/src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/image/dao/MarketImageDao.kt @@ -86,7 +86,6 @@ import org.jooq.Condition import org.jooq.DSLContext import org.jooq.Record import org.jooq.Record1 -import org.jooq.Record18 import org.jooq.Record19 import org.jooq.Result import org.jooq.UpdateSetFirstStep