bk-ci
bk-ci copied to clipboard
缩减微服务的子模块数量
每个微服务只保留api/biz/boot/model 4个模块. 原其他子模块的代码按包名规划合入区分:
规范:
以store微服务为例: 镜像商店api包 api-store-image 合入 api-store 原api-store-image 代码中api部分需要按包名规划 com.tencent.devops.store.api.image 区分出来即可. 可保持文件目录结构独立和用途清晰, 为什么不调整成
biz-xxx-xxx 也采用相同的逻辑来处理. 最佳的包命名方式是: com.tencent.devops.store.image.dao com.tencent.devops.store.image.service com.tencent.devops.store.image.resources com.tencent.devops.store.image....
注意事项: 1、 api-store-image包为什么不调整成 com.tencent.devops.store.image.api 呢, 这里涉及到Client.kt的包解析代码 com.tencent.devops.([a-z]+).api.([a-zA-Z]+) 点击查看 所以暂时维持: com.tencent.devops.store.api.image , 如果要修改,则需要同步修改一下Client.kt的实现.
2、 如遇到biz-xxx-sample 中可能带有一些Configuration 有初始化**@Bean** 的实现逻辑, 在合并后,会被注入,可能会存在与ext部分发生冲突. 解决办法:
- 1:通过@Bean声明创建的Service, 将源代码文件中声明的注解@Servcie去掉, 在sample部分的Configuration Bean补充 @ConditionalOnMissingBean(xxxx::class) , 并在ext部分使用@Primary来优先加载扩展实现.
需要整改合并的子模块有:
- [x] artifactory
- [x] #9222
- [x] dispatch
- [x] dispatch-bcs 服务要从settings中移除,因已经不存在了
- [x] dispatch-docker
- [x] dispatch-kubernetes
- [x] dockerhost
- [x] #9252
- [ ] #9224
- [x] #9229
- [ ] #9228
- [x] monitoring
- [x] #9230
- [x] #9231
- [x] #9307
- [ ] project
- [x] quality
- [x] #9226
- [x] #9225
- [x] #9227
- [x] #9275