3

The idea is:

  1. all devs work on their feature branches and push them to github
  2. jenkins starts builds (triggered by "push on github") on job test to run unit tests on those feature branches
  3. Once they pass the test, manager goes to github to do code review.
  4. 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: enter image description here

job test-prod SCM config: enter image description here

So 2 questions here:

  1. 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

  2. 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!

Slav
  • 27,057
  • 11
  • 80
  • 104
user378132
  • 311
  • 1
  • 4
  • 11
  • This may be of interest http://stackoverflow.com/questions/23204729/legacy-code-started-this-job-no-cause-information-is-available – Slav Apr 24 '14 at 20:59
  • Hey user, we just figured out the cause of the `"Legacy code started this job"` in the above linked answer. See if that applies to you as well. He had `Build when another project is promoted` configured, which you shouldn't use when using `Trigger/Call builds` – Slav Apr 25 '14 at 13:35

1 Answers1

0

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.

Community
  • 1
  • 1
Slav
  • 27,057
  • 11
  • 80
  • 104