[JIRA] (JENKINS-54864) github multibranch builds fail to build with latest branch api update

6 views
Skip to first unread message

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 26, 2018, 10:29:02 PM11/26/18
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Jenkins / Bug JENKINS-54864
github multibranch builds fail to build with latest branch api update
Change By: Mark Waite
Summary: github multibranch builds fail to build with latest branch api and git plugin update
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jcrow@cwcweb.com (JIRA)

unread,
Nov 30, 2018, 8:53:02 AM11/30/18
to jenkinsc...@googlegroups.com
Jason Crow commented on Bug JENKINS-54864
 
Re: github multibranch builds fail to build with latest branch api update

Does anyone know what's going on with branch api plugin 2.1.1? We have continuous deployment pipeline that's dependent on PR builds to pass github checks and the PR's never build with this plugin version.

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 30, 2018, 8:59:03 AM11/30/18
to jenkinsc...@googlegroups.com

rsandell and Jesse Glick were involved in the most recent release of the branch API plugin, though the changes from branch api plugin 2.1.0 to 2.1.1 seem unlikely to have caused this change of behavior.

jglick@cloudbees.com (JIRA)

unread,
Nov 30, 2018, 11:29:02 AM11/30/18
to jenkinsc...@googlegroups.com

jcrow@cwcweb.com (JIRA)

unread,
Nov 30, 2018, 11:45:02 AM11/30/18
to jenkinsc...@googlegroups.com

Mark Waite I don't think it was between 2.1.0 and 2.1.1, I had to roll back to 2.0.21 to return to a "semi-functioning" pipeline - still seeing unexplained issues with PR builds with discovery and status reporting back to github.

stephen.alan.connolly@gmail.com (JIRA)

unread,
Nov 30, 2018, 11:49:03 AM11/30/18
to jenkinsc...@googlegroups.com

I suspect you had "Automatic branch project triggering" configured to something like master, PR-*

This gets mapped to matching branches that have the set of names as automatic build, but doesn't include Pull requests in automatic builds. As a workaround, just add Pull Requests to the build strategies and pull requests should start building.

If somebody is interested in fixing this you would need to:

  • Establish that all SCMSource implementations only use PR- as the prefix for pull requests... if there is an SCMSource implementation that uses something like CR- then we cannot fix this issue as we would not know if PR-* is intended to target branches that start with PR- or pull requests.
  • If we know that PR- is guaranteed to only apply to pull requests, then modify the migration so that it parses the "Automatic branch project triggering" value, pulls out the PR- ones and adds named branch build strategies for all others. If there is any PR- entries then add the change request build strategy

jglick@cloudbees.com (JIRA)

unread,
Nov 30, 2018, 11:51:35 AM11/30/18
to jenkinsc...@googlegroups.com

AFAICT you need to install a new Basic Branch Build Strategies plugin to recover that functionality, and there should have been an administrative monitor displayed to alert you to this fact.

jglick@cloudbees.com (JIRA)

unread,
Nov 30, 2018, 11:52:01 AM11/30/18
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Nov 30, 2018, 11:52:01 AM11/30/18
to jenkinsc...@googlegroups.com
Jesse Glick edited a comment on Bug JENKINS-54864
- AFAICT you need to install a new *Basic Branch Build Strategies* plugin to recover that functionality, and there should have been an administrative monitor displayed to alert you to this fact. - (pay attention to what [~stephenconnolly] wrote instead)

jcrow@cwcweb.com (JIRA)

unread,
Nov 30, 2018, 11:53:01 AM11/30/18
to jenkinsc...@googlegroups.com

jcrow@cwcweb.com (JIRA)

unread,
Nov 30, 2018, 12:07:02 PM11/30/18
to jenkinsc...@googlegroups.com
Jason Crow edited a comment on Bug JENKINS-54864
[~stephenconnolly] My Automatic branch project triggering is set to .*

The Basic Branch Build Strategies plugin is installed, when I went through this upgrade the only way I got PR's to build automatically again was to rollback the branch-api-plugin to 2.0.21.  Hence the following message:

*Dependency errors:*

Some plugins could not be loaded due to unsatisfied dependencies. Fix these issues and restart Jenkins to restore the functionality provided by these plugins.

Basic Branch Build Strategies Plugin version 1.1.1

Branch API Plugin v2.0.21 is older than required. To fix, install v2.1.0 or later.

steve@spmason.com (JIRA)

unread,
Dec 4, 2018, 5:15:01 AM12/4/18
to jenkinsc...@googlegroups.com

Just to add - we had this problem and adding the "Change requests" build strategy seems to have made our PRs build automatically again on the latest version of the plugin

jcrow@cwcweb.com (JIRA)

unread,
Dec 4, 2018, 7:56:02 PM12/4/18
to jenkinsc...@googlegroups.com

Thanks Steve Mason this fixes the issue. I think this was more a difference in plugin functionality than anything else. This issue could probably be closed.

steve@spmason.com (JIRA)

unread,
Dec 5, 2018, 8:36:03 AM12/5/18
to jenkinsc...@googlegroups.com

The only bug I can see is that this config should have been copied over from the previous version correctly

stephen.alan.connolly@gmail.com (JIRA)

unread,
Dec 5, 2018, 9:06:04 AM12/5/18
to jenkinsc...@googlegroups.com
Stephen Connolly edited a comment on Bug JENKINS-54864
So if somebody can come up with an expression parser for the old configuration string that can reliably distinguish between:

* {{PR-
\ *}} means build all *branches* whos names begin with {{PR-}} such as {{PR-foobar}} and do not build pull requests because our SCMSource doesn't even have the concept.
* {{PR-
\ *}} means build all *pull-requests* but we don't want to accidentally build branches with names that begin with {{PR-}} because we just want to build the {{master}} branch.
* {{CR-
\ *}} means build all *pull-requests* because our SCMSource calls them Change Requests and uses {{CR-}} as the prefix

I would be happy to merge.

Until then, the least risk (given that building a branch can result in deploying things into production or expose secrets to a build that isn't trusted) is to err on the side of "if we don't know, do nothing".

In any case, we could argue that the old `Automatic branch project triggering` has a bug of _requiring_ you to  know to add {{PR-
\ *}} in order to build pull requests... just that people were relying on the bug!

stephen.alan.connolly@gmail.com (JIRA)

unread,
Dec 5, 2018, 9:06:04 AM12/5/18
to jenkinsc...@googlegroups.com

So if somebody can come up with an expression parser for the old configuration string that can reliably distinguish between:

  • PR- means build all *branches whos names begin with PR- such as PR-foobar and do not build pull requests because our SCMSource doesn't even have the concept.
  • PR- means build all *pull-requests but we don't want to accidentally build branches with names that begin with PR- because we just want to build the master branch.
  • CR- means build all *pull-requests because our SCMSource calls them Change Requests and uses CR- as the prefix

I would be happy to merge.

Until then, the least risk (given that building a branch can result in deploying things into production or expose secrets to a build that isn't trusted) is to err on the side of "if we don't know, do nothing".

In any case, we could argue that the old `Automatic branch project triggering` has a bug of requiring you to know to add PR-* in order to build pull requests... just that people were relying on the bug!

stephen.alan.connolly@gmail.com (JIRA)

unread,
Dec 5, 2018, 9:11:01 AM12/5/18
to jenkinsc...@googlegroups.com

And just in case somebody says "who'd call your branches PR-*?" suppose you are using JIRA and your JIRA project ID is PR... then it might make extreme sense to name all your branches by the JIRA ID that they are developing... so that JIRA ID PR-5612 is in the branch PR-5612... if you are using an SCMSource that doesn't have Change Requests... perhaps you rolled a custom one similar to https://github.com/stephenc/asf-gitpubsub-jenkins-plugin for your own in-house GIT hosting...

You might not want to build any of the OPS ticket branches on your Jenkins, so you just set the automatic building to master,PR-*

So if we are going to embed the logic to figure these things out into code... we should handle the above!

jonathan_tancer@colpal.com (JIRA)

unread,
Dec 7, 2018, 8:53:02 AM12/7/18
to jenkinsc...@googlegroups.com

I can confirm Steve Mason's solution fixed our issue.

For posterity:

If you use GitHub Organizations with Jenkins and Jenkins is no longer building commits from PR branches, perform the following steps to resolve the issue

  1. Open the GitHub Organization folder
  2. On the left hand side, select Configure
  3. Scroll down to Build Strategies which is nested underneath the Projects section
  4. Press Add
  5. Select Change requests
  6. Scroll down to the bottom of the page and press Save

{{}}{{}}You will now see the GitHub Organization being re-scanned and all your missing PR builds will begin to build.

 

John.Mellor@esentire.com (JIRA)

unread,
Dec 10, 2018, 4:43:02 PM12/10/18
to jenkinsc...@googlegroups.com

Can someone please detail the alleged workaround details?  I do not see the config sections noted by Steve Mason and Jon Tancer in either of my sites.  I see the note above explaining what I should alter in the github section config when I use the deprecated and replaced organization plugin, but not how to do this in an up-to-date system.  Is it possible to perform a workaround without using the do-not-use plugins?

 

mark.earl.waite@gmail.com (JIRA)

unread,
Dec 10, 2018, 4:50:07 PM12/10/18
to jenkinsc...@googlegroups.com

John Mellor did you review the comment from Stephen Connolly? He noted:

Add Pull Requests to the build strategies and pull requests should start building.

John.Mellor@esentire.com (JIRA)

unread,
Dec 11, 2018, 8:56:02 AM12/11/18
to jenkinsc...@googlegroups.com
John Mellor updated an issue
 
Change By: John Mellor
Attachment: Screenshot from 2018-12-11 08-53-26.png

John.Mellor@esentire.com (JIRA)

unread,
Dec 11, 2018, 8:57:02 AM12/11/18
to jenkinsc...@googlegroups.com
John Mellor commented on Bug JENKINS-54864
 
Re: github multibranch builds fail to build with latest branch api update

Sorry for being obtuse, but pull requests ARE in the build stategies already.  I do not see what I should have to add to all the jobs.  Typical job screenshot attached.  What needs to be added?

steve@spmason.com (JIRA)

unread,
Dec 11, 2018, 10:37:03 AM12/11/18
to jenkinsc...@googlegroups.com
Steve Mason updated an issue
 
Change By: Steve Mason
Attachment: image-2018-12-11-15-36-45-141.png

steve@spmason.com (JIRA)

unread,
Dec 11, 2018, 10:38:04 AM12/11/18
to jenkinsc...@googlegroups.com
Steve Mason updated an issue
Change By: Steve Mason
Comment: [~alt_jmellor] you want the section "Build strategies" - that section is under "GitHub Organisation" higher up. I've tried to squeeze everything onto the same screenshot here:

 

!image-2018-12-11-15-36-45-141.png!

steve@spmason.com (JIRA)

unread,
Dec 11, 2018, 10:38:04 AM12/11/18
to jenkinsc...@googlegroups.com
Steve Mason commented on Bug JENKINS-54864
 
Re: github multibranch builds fail to build with latest branch api update

John Mellor you want the section "Build strategies" - that section is under "GitHub Organisation" higher up. I've tried to squeeze everything onto the same screenshot here:

 

steve@spmason.com (JIRA)

unread,
Dec 11, 2018, 10:42:03 AM12/11/18
to jenkinsc...@googlegroups.com
Steve Mason updated an issue
Change By: Steve Mason
Attachment: image-2018-12-11-15-41-20-455.png

steve@spmason.com (JIRA)

unread,
Dec 11, 2018, 10:42:03 AM12/11/18
to jenkinsc...@googlegroups.com
 
Re: github multibranch builds fail to build with latest branch api update

John Mellor That section is "GitHub Organisation", you want to add the "Change requests" strategy under "Build strategies"  See this screenshot:

 

steve@spmason.com (JIRA)

unread,
Dec 11, 2018, 10:43:02 AM12/11/18
to jenkinsc...@googlegroups.com
Steve Mason edited a comment on Bug JENKINS-54864
[~alt_jmellor] That section is "GitHub Organisation", you want to add the "Change requests" strategy under the "Build strategies"   section. See this screenshot:

 

!image-2018-12-11-15-41-20-455.png!

John.Mellor@esentire.com (JIRA)

unread,
Dec 11, 2018, 11:58:06 AM12/11/18
to jenkinsc...@googlegroups.com
John Mellor updated an issue
 
Change By: John Mellor
Attachment: Screenshot from 2018-12-11 11-54-26.png

John.Mellor@esentire.com (JIRA)

unread,
Dec 11, 2018, 11:58:07 AM12/11/18
to jenkinsc...@googlegroups.com
John Mellor commented on Bug JENKINS-54864
 
Re: github multibranch builds fail to build with latest branch api update

Thanks Steve, but I still do not have enough context.  I do not have that section in the job configs like you do.  What plugin provides that configuration section?  Screenshot of what I see attached.

airey.andy+jenkins@gmail.com (JIRA)

unread,
Dec 12, 2018, 7:58:02 AM12/12/18
to jenkinsc...@googlegroups.com

I'm also facing this issue and also didn't see this option (using Bitbucket Branch Source Plugin).
It only appears when you migrate to the "Named Branch Plugin", following this message from the Recommendations (the number with red background in the top bar of the UI in Jenkins):

The "Automatic branch project triggering" option has been replaced with a "Named branch" build strategy

mark.earl.waite@gmail.com (JIRA)

unread,
Dec 12, 2018, 10:45:01 AM12/12/18
to jenkinsc...@googlegroups.com

Andy Airey for the benefit of others that may refer to this bug report, would you be willing to attach a screenshot of the Bitbucket Branch Source Plugin configuration setting?

I realize that this bug report is about the GitHub multibranch, but many readers may find it and assume that Bitbucket and GitHub plugins have the same options and same configurations (which they do not).

airey.andy+jenkins@gmail.com (JIRA)

unread,
Dec 19, 2018, 2:44:02 AM12/19/18
to jenkinsc...@googlegroups.com
Andy Airey updated an issue
 
Change By: Andy Airey
Attachment: bitbucket-branch-source-plugin-config.png

s.gagnon@robotiq.com (JIRA)

unread,
Jan 27, 2019, 3:52:06 PM1/27/19
to jenkinsc...@googlegroups.com

s.gagnon@robotiq.com (JIRA)

unread,
Jan 27, 2019, 3:52:06 PM1/27/19
to jenkinsc...@googlegroups.com
Sebastien Gagnon assigned an issue to Unassigned

s.gagnon@robotiq.com (JIRA)

unread,
Jan 27, 2019, 3:53:07 PM1/27/19
to jenkinsc...@googlegroups.com
Sebastien Gagnon commented on Bug JENKINS-54864
 
Re: github multibranch builds fail to build with latest branch api update

Hi,

Same problem on my side.

Any update on this issue ?

Thanks

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 27, 2019, 5:17:04 PM1/27/19
to jenkinsc...@googlegroups.com

Sebastien Gagnon did you apply the instructions in the summary of the configuration change that is usually the best way to resolve the issue?

John.Mellor@esentire.com (JIRA)

unread,
Jan 28, 2019, 9:09:02 AM1/28/19
to jenkinsc...@googlegroups.com

Instead of suggesting that people apply the workaround, having to fix hundreds of thousands of jobs worldwide, how about just reverting the breaking change?  I alone have 3570 jobs to inspect and make a code change to because of this error.  How do I get back to the point of NOT having to make this change, and simply have the github functionality work as expected?

 

batmat@batmat.net (JIRA)

unread,
Jan 31, 2019, 7:52:05 AM1/31/19
to jenkinsc...@googlegroups.com

John Mellor we understand your frustration, but please be more careful with your phrasing, and be respectful of people time here. This is not a customer support channel.

dnusbaum@cloudbees.com (JIRA)

unread,
Jul 25, 2019, 3:30:06 PM7/25/19
to jenkinsc...@googlegroups.com
Devin Nusbaum resolved as Fixed
 

Version 2.5.4 of Branch API plugin was just released. This version undeprecates the original property (and two others that were deprecated at the same time) and disables the automatic migration going forward (but does not try to reverse it automatically to avoid making things worse).

Change By: Devin Nusbaum
Status: Open Resolved
Assignee: Devin Nusbaum
Resolution: Fixed
Released As: branch-api 2.5.4

kivagant@gmail.com (JIRA)

unread,
Oct 1, 2019, 9:32:07 AM10/1/19
to jenkinsc...@googlegroups.com
Eugene G commented on Bug JENKINS-54864
 
Re: github multibranch builds fail to build with latest branch api update

I upgraded Branch API plugin from 2.1.2 to 2.5.4 and still see the same message in the logs:

  Checking branch dummy
      ‘Jenkinsfile’ found
    Met criteria
Changes detected: dummy (null → cd9913c17e529deb34a84ae6f3d21ab647fedd52)
No automatic build triggered for dummy

Build strategies for GitHub Organization contain "Change requests" strategy and "Ignore rebuilding merge branches when only the target branch changed" flag is enabled.
"Discover branches" strategy has "Exclude branches that are also filed as PRs" value but there's no PR for the "dummy" branch that I created. Pull Requests trigger builds as expected, but new branches are ignored.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kivagant@gmail.com (JIRA)

unread,
Oct 1, 2019, 9:38:12 AM10/1/19
to jenkinsc...@googlegroups.com
Eugene G edited a comment on Bug JENKINS-54864
I upgraded Branch API plugin from 2.1.2 to 2.5.4 and still see the same message in the logs:

{code}

  Checking branch dummy
      ‘Jenkinsfile’ found
    Met criteria
Changes detected: dummy (null → cd9913c17e529deb34a84ae6f3d21ab647fedd52)
No automatic build triggered for dummy
{code}


Build strategies for GitHub Organization contain "Change requests" strategy and "Ignore rebuilding merge branches when only the target branch changed" flag is enabled.
"Discover branches" strategy has "Exclude branches that are also filed as PRs" value but there's no PR for the "dummy" branch that I created. Pull Requests trigger builds as expected, but new branches are ignored.

*Update:* I just added another rule into the "Build strategies" section of the GitHub Organization properties. The "Named branches" rule with "*" wildcard triggered all the builds even though I still see that "null → something" in the logs.

{code}

   Checking branch dummy
      ‘Jenkinsfile’ found
    Met criteria
Changes detected: dummy (null → cd9913c17e529deb34a84ae6f3d21ab647fedd52)
Scheduled build for branch: dummy
{code}


!image-2019-10-01-16-35-50-526.png|width=100%!
Reply all
Reply to author
Forward
0 new messages