From 3708e0aec1b17496fb061b5052d38205eca0aea5 Mon Sep 17 00:00:00 2001 From: yjieliang Date: Mon, 23 Oct 2023 18:27:27 +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 --- .../atom/impl/AtomReleaseServiceImpl.kt | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) 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 96310f0c074..99abf7e9c35 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 @@ -691,7 +691,6 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ branch: String? = null ): GetAtomQualityConfigResult { try { - val testVersionFlag = branch?.let { it != MASTER } ?: false val qualityJsonStr = getFileStr( projectCode = projectCode, atomCode = atomCode, @@ -723,8 +722,8 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ // 先注册基础数据 val metadataResultMap = registerMetadata( userId = userId, - atomCode = if (testVersionFlag) "$atomCode-$branch" else atomCode, - atomName = if (testVersionFlag) "$atomName-$branch" else atomName, + atomCode = atomCode, + atomName = atomCode, indicators = indicators ) @@ -732,8 +731,8 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ registerIndicator( userId = userId, projectId = projectCode, - atomCode = if (testVersionFlag) "$atomCode-$branch" else atomCode, - atomName = if (testVersionFlag) "$atomName-$branch" else atomName, + atomCode = atomCode, + atomName = atomCode, atomVersion = atomVersion, stage = stageCode, metadataResultMap = metadataResultMap, @@ -743,8 +742,8 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ // 最后注册控制点 registerControlPoint( userId = userId, - atomCode = if (testVersionFlag) "$atomCode-$branch" else atomCode, - atomName = if (testVersionFlag) "$atomName-$branch" else atomName, + atomCode = atomCode, + atomName = atomCode, atomVersion = atomVersion, stage = stageCode, projectId = projectCode @@ -753,12 +752,9 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ GetAtomQualityConfigResult("0", arrayOf("")) } else { try { - client.get(ServiceQualityIndicatorMarketResource::class) - .deleteTestIndicator(if (testVersionFlag) "$atomCode-$branch" else atomCode) - client.get(ServiceQualityMetadataMarketResource::class) - .deleteTestMetadata(if (testVersionFlag) "$atomCode-$branch" else atomCode) - client.get(ServiceQualityControlPointMarketResource::class) - .deleteTestControlPoint(if (testVersionFlag) "$atomCode-$branch" else atomCode) + client.get(ServiceQualityIndicatorMarketResource::class).deleteTestIndicator(atomCode) + client.get(ServiceQualityMetadataMarketResource::class).deleteTestMetadata(atomCode) + client.get(ServiceQualityControlPointMarketResource::class).deleteTestControlPoint(atomCode) } catch (ignored: Throwable) { logger.warn("clear atom:$atomCode test quality data fail", ignored) }