-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pref:研发商店组件内置打包流水线都归属到统一的平台项目下 #10475 #11046
base: master
Are you sure you want to change the base?
pref:研发商店组件内置打包流水线都归属到统一的平台项目下 #10475 #11046
Conversation
…fix' into issue_10475_innerPipeline_fix_yj
# Conflicts: # src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/atom/service/impl/MarketAtomEnvServiceImpl.kt # src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreProjectServiceImpl.kt
# Conflicts: # src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/dao/StoreProjectRelDao.kt # src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/common/service/impl/StoreProjectServiceImpl.kt
userId: String, | ||
storeCode: String, | ||
storeType: Byte | ||
): Boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
安装类型的条件不需要加吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整
pipelineId = it | ||
) | ||
} | ||
logger.info("handleStoreBuildResult pipelineId:${storeBuildInfoRecord?.pipelineId},storeType:$storeType") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这行日志已经包含方法前面一行日志信息,而且这种日志信息打印作用不大,可以考虑去掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整
) | ||
} | ||
logger.info("handleStoreBuildResult pipelineId:${storeBuildInfoRecord?.pipelineId},storeType:$storeType") | ||
if (storeType == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这逻辑没看懂,T_STORE_PIPELINE_REL表会存在storeType为空的情况吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整
@@ -301,9 +301,10 @@ abstract class StoreCommonServiceImpl : StoreCommonService { | |||
val storeBuildInfoRecord = storePipelineBuildRelDao.getStorePipelineBuildRel(dslContext, storeId) | |||
if (null != storeBuildInfoRecord) { | |||
val pipelineId = storeBuildInfoRecord.pipelineId | |||
val storePipelineRelRecord = storePipelineRelDao.getStorePipelineRelByPipelineId( | |||
val storePipelineRelRecord = storePipelineRelDao.getStorePipelineRelByStoreCode( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么要把getStorePipelineRelByPipelineId方法切换至getStorePipelineRelByStoreCode,原来用流水线ID不是可以正常查出记录吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为内置流水线归属公共项目管理后storeRel存在多个组件管理同一流水线的情况
@@ -404,6 +407,9 @@ abstract class StoreMemberServiceImpl : StoreMemberService { | |||
* 判断是否为成员 | |||
*/ | |||
override fun isStoreMember(userId: String, storeCode: String, storeType: Byte): Boolean { | |||
if (userId == storeInnerPipelineConfig.innerPipelineUser) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个逻辑加在这里不合适,innerPipelineUser不一定是组件成员,这个逻辑放在外面去判断,比如userId == storeInnerPipelineConfig.innerPipelineUser || isStoreMember(xxx)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整
// 触发执行流水线 | ||
val buildIdObj = client.get(ServiceBuildResource::class).manualStartupNew( | ||
userId = innerPipelineUser, | ||
projectId = storePipelineRelRecord?.projectCode ?: innerPipelineProject, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用这个逻辑,要求流水线都是挂在innerPipelineProject和innerPipelineUser下面
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整
lock.lock() | ||
pipelineId = redisOperation.get(pipelineName) | ||
if (pipelineId.isNullOrBlank()) { | ||
val pipelineList = client.get(ServicePipelineResource::class).searchByName( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把各个组件公共流水线的流水线ID存在配置表和redis不就行了,为什么要搞这么复杂
params = arrayOf(storeCode ?: "$storeType-PIPELINE-BUILD:PUBLIC") | ||
) | ||
logger.info("handleStorePublicPipelineModel pipelineId:$pipelineId|publicPipelineId:$publicPipelineId") | ||
if (storeCode != null && pipelineId == publicPipelineId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这逻辑什么意思,没看懂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对已托管给公共项目的组件刷新内置流水线model时则给组件在公共项目下创建单独的流水线
pref:研发商店组件内置打包流水线都归属到统一的平台项目下 #10475