如何处理jenkins上推广的冲突分支 [英] How to deal with promoted conflicting branches on jenkins
问题描述
这个想法是:
- 所有开发者都在他们的功能分支上工作并将他们推送到github上
- jenkins在作业 test 上开始构建(通过push on github)来在这些特性分支上运行单元测试
- 一旦他们通过测试,如果代码审查没问题,那么这个构建会被手动提升(促进构建插件)为通过QA,准备好产品,在actions中,部分中,我们设置了在其他项目上触发/调用构建以触发单独的作业 test-prod ,仅将此功能分支合并到远程回购的主文件中。
ol>
工作测试促进建立配置:
$ job $ test $ pr $ SCM配置
这里有两个问题:
-
在第4步中,我们遇到了两个相互冲突的特性分支都通过代码审查的情况,第一个分支被提升会很好,但其次会有冲突和失败,有没有办法在以前检测到冲突?我知道'构建之前的合并'可以避免冲突,但是这要求前一个分支已经合并到远程主数据库中,无论何时第二份工作是由手动提升触发的,总是会有一个额外的构建:遗留代码启动了这项工作,没有原因信息可用,我不知道这是怎么发生的。
-
另外,不知道这个想法在整个管道方面是否正确,欢迎提供任何建议!
声明:我对git一无所知。 根据 这个 ,最好的做法是使用变基
。因为我对git不熟悉,所以我不能告诉你如何在Jenkins上设置 rebase
。
是另一个海报,也有git问题和遗留代码开始这项工作触发额外的构建: 旧版代码启动了这项工作。没有原因信息 。
The idea is:
- all devs work on their feature branches and push them to github
- jenkins starts builds (triggered by "push on github") on job test to run unit tests on those feature branches
- Once they pass the test, manager goes to github to do code review.
- If code review is fine, then this build is promoted(promote build plugin) manually to "Pass QA, Ready for prod", in "actions" section, we set "trigger/call builds on other projects" to trigger a separate job test-prod only to merge this feature branch to master on remote repo.
job test promote build config:
job test-prod SCM config:
So 2 questions here:
on step 4, we have situations like 2 conflicting feature branches both passed code review, the first branch that is promoted will be fine, but the second will have conflicts and failure, is there a way to detect conflict before? I know 'merge before build' can avoid conflict but that requires the former branch already been merged to remote master
in no-conflict cases, whenever the second job is triggered by the manually promotion, there is always an extra build caused by: "Legacy code started this job. No cause information is available", I have no idea how that happens.
Also, dont know whether the idea is correct in terms of whole pipeline, any suggestions are welcome!
Disclaimer: I know nothing about git.
According to this, the best practice is to use rebase
. As I am not familiar with git, I can't tell you how to setup rebase
on Jenkins.
There is another poster here that also has issues with git and "Legacy code started this job" triggering extra builds: Legacy code started this job. No cause information is available.
这篇关于如何处理jenkins上推广的冲突分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!