Skip to content

Commit

Permalink
Merge pull request #9818 from yjieliang/bug-9815
Browse files Browse the repository at this point in the history
bug:修复支持插件使用分支开发存在的问题 #9815
  • Loading branch information
bkci-bot authored Dec 19, 2023
2 parents 52dcfab + 9500e8e commit f5da13e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class QualityMetadataService @Autowired constructor(
logger.info("QUALITY|refreshMetadata elementType: $elementType")
val data = metadataDao.listByElementType(dslContext, elementType)
val testData = data?.filter { it.extra == IN_READY_TEST } ?: listOf()
val prodData = data?.filter { it.extra != IN_READY_TEST } ?: listOf()
val prodData = data?.filter { !(it.extra.startsWith(IN_READY_TEST)) } ?: listOf()
val userId = testData.firstOrNull()?.createUser ?: ""

val resultMap = mutableMapOf<String, String>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ class AtomDao : AtomBaseDao() {
with(TAtom.T_ATOM) {
return dslContext.select(
VERSION.`as`(KEY_VERSION),
ATOM_STATUS.`as`(KEY_ATOM_STATUS)
ATOM_STATUS.`as`(KEY_ATOM_STATUS),
BRANCH_TEST_FLAG.`as`(KEY_BRANCH_TEST_FLAG)
).from(this)
.where(
generateGetPipelineAtomCondition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ package com.tencent.devops.store.resources.atom

import com.tencent.devops.common.api.pojo.Result
import com.tencent.devops.common.web.RestResource
import com.tencent.devops.common.web.annotation.SensitiveApiPermission
import com.tencent.devops.store.api.atom.BuildAtomResource
import com.tencent.devops.store.pojo.atom.MarketAtomUpdateRequest
import com.tencent.devops.store.pojo.common.StoreProcessInfo
Expand All @@ -46,13 +47,15 @@ class BuildAtomResourceImpl @Autowired constructor(
return atomService.getAtomDefaultValidVersion(projectCode, atomCode)
}

@SensitiveApiPermission("branch_test_version_management")
override fun createAtomBranchTestVersion(
userId: String,
marketAtomUpdateRequest: MarketAtomUpdateRequest
): Result<String> {
return atomReleaseService.creatAtomBranchTestVersion(userId, marketAtomUpdateRequest)
}

@SensitiveApiPermission("branch_test_version_management")
override fun endBranchVersionTest(userId: String, atomCode: String, branch: String): Result<Boolean> {
return atomReleaseService.endBranchVersionTest(userId, atomCode, branch)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ
atomCode = atomCode,
atomName = atomName,
indicators = indicators,
version = if (branch == MASTER) null else atomVersion
version = if (atomVersion.startsWith("$TEST-$branch-")) atomVersion else null
)

// 再注册指标
Expand Down

0 comments on commit f5da13e

Please sign in to comment.