Same Jenkins job for different git branches

28 views
Skip to first unread message

Sam K

unread,
Sep 19, 2016, 6:59:15 PM9/19/16
to Jenkins Users
How will it affect the list of changes it shows on the builds page?  

Build No. 10 was built with master branch
Build No. 11 is built with release_alpha branch
Build No. 12 is then built with master branch

Will changes between the builds be tracked correctly?  Will build no. 12 report changes between 10 and 12 and not between 11 and 12?  I see under the builds folders there are git commits, tree, parents, etc.  Is that's what used to determine?     

thanks
Sam


Mark Waite

unread,
Sep 19, 2016, 11:26:23 PM9/19/16
to Jenkins Users


On Monday, September 19, 2016 at 3:59:15 PM UTC-7, Sam K wrote:
How will it affect the list of changes it shows on the builds page?  

Build No. 10 was built with master branch
Build No. 11 is built with release_alpha branch
Build No. 12 is then built with master branch

Will changes between the builds be tracked correctly?  

It depends on your definition of "correct", and how useful that definition to your users.

The git plugin presents the differences between the preceding build and the current build as the "changes".  If the preceding build was for a different branch, then the differences are probably not useful to your users.  

The multi-branch freestyle job type and the multibranch pipeline job type will automatically create and delete a job for each branch that matches your selection criteria.  I very much prefer a job per branch because it makes the changes easier to read, and the history of test pass and fail much easier to understand.
 
Will build no. 12 report changes between 10 and 12 and not between 11 and 12?  
 
No, build 12 will report changes between 11 and 12, not between 10 and 12.  The difference computation is with the predecessor build, not with the predecessor build on that branch.

I see under the builds folders there are git commits, tree, parents, etc.  Is that's what used to determine?     


Yes, the git repository is used to determine the differences between builds.

Mark Waite
 
thanks
Sam


Klaus Rudolph

unread,
Sep 20, 2016, 2:22:48 AM9/20/16
to jenkins...@googlegroups.com, Jenkins Users
"Mark Waite" <mark.ea...@gmail.com> wrote:

> The multi-branch freestyle job type and the multibranch pipeline job type will automatically create and delete a job for each branch that matches your selection criteria.
> I very much prefer a job per branch because it makes the changes easier to read, and the history of test pass and fail much easier to understand.
 
But multibranch pipeline is today not in a state where it is a usable replacement for other job types. No graphics displayed from the plugins, many plugins are not compatible and also some plugins are not on the list for compatibility like cubertura. We started to migrate one job to multibranch pipeline but we had no success to find enough workarounds. And it lacks a bit of documentation. I believe it is the way it should work and it is on track, but today it is not usable for production.

Regards
Klaus

Sam K

unread,
Sep 23, 2016, 12:46:28 AM9/23/16
to Jenkins Users
Thanks for the reply Mark.  After posting the question, I started looking at the builds folders within the jobs and each build has a changelog which has a 'tree' in it.  I assume Jenkins will use that 'tree' to figure out the changes between branches?  Just guessing.  

I also ran some test builds.  I first ran a build on master and I got lucky that a developer was just in the process of checking in changes to the master.  i verified that by going to the github and checking the commit history.  then, I ran a build using the same job on a child branch.  The changes were reported as zero and it confirmed with the history on git.  

Then I ran another build on master again and it then the few more commits that the developer continued making to master.  
Reply all
Reply to author
Forward
0 new messages