Skip to content

Commit

Permalink
feat:希望支持分支进行上架测试 #4780
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Oct 23, 2023
1 parent 06789ee commit 3708e0a
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -723,17 +722,17 @@ 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
)

// 再注册指标
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,
Expand All @@ -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
Expand All @@ -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)
}
Expand Down

0 comments on commit 3708e0a

Please sign in to comment.