Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54864

github multibranch builds fail to build with latest branch api update

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • branch-api-plugin
    • None
    • Jenkins 2.138.3 on Ubuntu
      git plugin 3.9.1 and branch api plugin 2.1.1 is broken.
      git plugin 3.9.0 and branch api plugin 2.0.21 is ok.
    • branch-api 2.5.4

      The latest updates broke github multibranch builds.

      The branches are being discovered, but all automaticdiscovery of all new changes on all branches results in the following typical log entries:

      Checking pull-requests...
       
      Checking pull request #3
      ‘Jenkinsfile’ found
      Met criteria
      Changes detected: PR-3 (null → 24d2f4cb5debd9b3f6f8c86383eb077be0dee0c4+517f061b1a7db844659ca98d1b61a7dcd0b6fb82)
      No automatic builds for PR-3

      These builds should have triggered.  Backing out to the last stable set of plugins fixes the problem.

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

          John Mellor added a comment -

          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.

          John Mellor added a comment - 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.

          Andy Airey added a comment -

          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

          Andy Airey added a comment - 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 Waite added a comment -

          aairey 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).

          Mark Waite added a comment - aairey  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).

          Hi,

          Same problem on my side.

          Any update on this issue ?

          Thanks

          Sebastien Gagnon added a comment - Hi, Same problem on my side. Any update on this issue ? Thanks

          Mark Waite added a comment -

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

          Mark Waite added a comment - sebgagn did you apply the instructions in the summary of the configuration change that is usually the best way to resolve the issue?

          John Mellor added a comment -

          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?

           

          John Mellor added a comment - 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?  

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

          Baptiste Mathus added a comment - alt_jmellor 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.

          Devin Nusbaum added a comment -

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

          Devin Nusbaum added a comment - 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).

          Eugene G added a comment - - edited

          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.

          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.

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

          Eugene G added a comment - - edited 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. 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. Checking branch dummy ‘Jenkinsfile’ found Met criteria Changes detected: dummy ( null → cd9913c17e529deb34a84ae6f3d21ab647fedd52) Scheduled build for branch: dummy

          Pedro added a comment - - edited

          As far as I understand, "Automatic Branch Project Triggering" should not be appearing on the settings anymore. But I'm still seeing that option on my instance, as shown below:


          And as some here have commented, I'm not able to see the "Build Strategies" section under Projects. Currently on Jenkins 2.289.1, Branch API v2.6.4.

          Excuse me if this is not the proper way to comment on an old thread, but what has been shown here solves a constraint I'm having and I'm not able to apply it because I'm not able to see it.

          UPDATE: Checked the documentation here and found that I was missing the Basic Branch Build Strategies plugin.

          Pedro added a comment - - edited As far as I understand, "Automatic Branch Project Triggering" should not be appearing on the settings anymore. But I'm still seeing that option on my instance, as shown below: And as some here have commented, I'm not able to see the "Build Strategies" section under Projects. Currently on Jenkins 2.289.1, Branch API v2.6.4. Excuse me if this is not the proper way to comment on an old thread, but what has been shown here solves a constraint I'm having and I'm not able to apply it because I'm not able to see it. UPDATE: Checked the documentation here and found that I was missing the Basic Branch Build Strategies plugin.

            dnusbaum Devin Nusbaum
            alt_jmellor John Mellor
            Votes:
            8 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved: