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

Does multibranch-build-strategy-extension plugin work at all?

      Hi,

      My impression is that this plugin is non-functional, at least when used with the pollSCM trigger. None of the options for triggering builds only when files in a particular directory are changed, or suppressing builds when files in excluded dirs are changed appear to work. Eg in my job, I've set Branch Sources --> Property strategy --> Build Strategies --> Accept build by included regions strategy --> in the "Trigger builds for included regions" text box, I've typed my/dir/**

      Yet when changes are made outside my/dir/** a build is triggered.

      The regions directory patterns don't seem to be evaluated. My job is triggered and logs show:

      j.scm.impl.SCMTriggerListener#onSCMHeadEvent: Triggering polling of myjob/my-branch
      h.triggers.SCMTrigger$Runner#run: SCM changes detected in myjob >> my-branch. Triggering
      

      If this was working, when I commit the irrelevant file, I would expect to see eg log message:

      c.i.j.p.m.b.IncludeRegionBranchBuildStrategy#shouldRunBuild: No matching any included regions, skipping build
      

      But this is only logged when I configure my job, not at build time. Nor are there any other logs containing "BuildStrategy" at build-time. Nothing except INFO level messages are logged at build time.

      Same occurs if I type "**" in Cancel build by excluded regions strategy --> Don't trigger build for excluded regions, which should avoid triggering ANY builds. Any file change wrongly triggers, when none should.

      Using latest LTS Jenkins (v2.462.1) and latest multibranch-build-strategy plugin (v51.v88f14e2a_4075). Is anyone successfully using this plugin?

      BTW, I've followed a couple of tips in issues about this plugin, such as ignoring builds triggered by indexing using "suppress automatic SCM triggering" in my jobs, and I'm setting a unique ID for each of my jobs. No dice.

      Thanks.

          [JENKINS-73598] Does multibranch-build-strategy-extension plugin work at all?

          Mark Waite added a comment -

          Thanks yylsebastian! Are you interested in adopting the plugin so that you can build and deliver a new release? You could also enable automatic releases as a way to simplify the future maintenance of the plugin.

          Mark Waite added a comment - Thanks yylsebastian ! Are you interested in adopting the plugin so that you can build and deliver a new release? You could also enable automatic releases as a way to simplify the future maintenance of the plugin.

          Ioan added a comment -

          yylsebastian can you send us the pom.xml file with the versions that worked for you?
          We tried to use latest dependencies, but is not working.

          Ioan added a comment - yylsebastian can you send us the pom.xml file with the versions that worked for you? We tried to use latest dependencies, but is not working.

          Sebastian added a comment -

          icatana Sure, here is the file: pom.xml

          markewaite Sorry, I don't have the time to adopt the plugin.

          Sebastian added a comment - icatana Sure, here is the file: pom.xml markewaite Sorry, I don't have the time to adopt the plugin.

          Mark Waite added a comment - - edited

          Sorry, I don't have the time to adopt the plugin.

          No problem. legall_benoit has adopted the plugin and has already released a version of the plugin that includes most of the changes from your pom file. I've submitted a pull request that further simplifies dependency management for the plugin.

          icatana have you tested the most recent release of the plugin? If so, can you provide detailed steps so that others can duplicate the issue that you are seeing?

          Mark Waite added a comment - - edited Sorry, I don't have the time to adopt the plugin. No problem. legall_benoit has adopted the plugin and has already released a version of the plugin that includes most of the changes from your pom file. I've submitted a pull request that further simplifies dependency management for the plugin. icatana have you tested the most recent release of the plugin? If so, can you provide detailed steps so that others can duplicate the issue that you are seeing?

          Ioan added a comment -

          markewaite I just did a build, and waiting to add into Jenkins, 
          the only concern is that we are using Jenkins `2.479.2` build, and this is for `2.426.3`
          I will let you know in a few minutes if this works for our version.

          Ioan added a comment - markewaite I just did a build, and waiting to add into Jenkins,  the only concern is that we are using Jenkins `2.479.2` build, and this is for `2.426.3` I will let you know in a few minutes if this works for our version.

          Mark Waite added a comment -

          If you are building your own version, then you probably should try the incremental build from my pull request. It is already built and has further simplified the pom.xml file by relying on the plugin BOM to define the versions of dependent plugins.

          Mark Waite added a comment - If you are building your own version, then you probably should try the incremental build from my pull request . It is already built and has further simplified the pom.xml file by relying on the plugin BOM to define the versions of dependent plugins.

          Ioan added a comment - - edited

          markewaite 

          • we did try the latest version of the plugin, without success
          • I tried to build the pom file provided by Sebastian, without success.

          I will try now to update from your PR. 

          Our settings that worked before is:

          Build Strategies:
            Any Strategies Match:
              Accept build by included regions strategy:
                env-uat/eu-west-1/services/**
                modules/services/*/

          We have separate multibranch pipelines for infra and services, and the issue is that it triggered both pipelines and the match doesn't work anymore.

          We also tried to remove Any Strategies Match, or add All strategies match, same issue.

          trying now to build from your PR.

          Ioan added a comment - - edited markewaite   we did try the latest version of the plugin, without success I tried to build the pom file provided by Sebastian, without success. I will try now to update from your PR.  Our settings that worked before is: Build Strategies:   Any Strategies Match:     Accept build by included regions strategy:       env-uat/eu-west-1/services/**       modules/services/* / We have separate multibranch pipelines for infra and services, and the issue is that it triggered both pipelines and the match doesn't work anymore. We also tried to remove Any Strategies Match, or add All strategies match, same issue. trying now to build from your PR.

          Ioan added a comment -

          markewaite is still not working with your PR for us  

          I don't have any other solutions in my mind right now.

          Ioan added a comment - markewaite is still not working with your PR for us   I don't have any other solutions in my mind right now.

          Sebastian added a comment -

          I can confirm that we are actually also still experiencing issues, e.g. a build for all regions is triggered even though only one is allowed.

          Sebastian added a comment - I can confirm that we are actually also still experiencing issues, e.g. a build for all regions is triggered even though only one is allowed.

          This plugin is working like a champ for me. I did just find an issue when used with the GitLab Branch Source plugin which causes this plugin to not properly test for changes in merge requests. I submitted a fix to the GitLab Branch Source plugin here: https://github.com/jenkinsci/gitlab-branch-source-plugin/pull/469

          In addition, I also submitted the following fix https://github.com/jenkinsci/multibranch-build-strategy-extension-plugin/pull/52 to this plugin that addresses https://issues.jenkins.io/browse/JENKINS-67128 and https://issues.jenkins.io/browse/JENKINS-60882

          Patrick McNerthney added a comment - This plugin is working like a champ for me. I did just find an issue when used with the GitLab Branch Source plugin which causes this plugin to not properly test for changes in merge requests. I submitted a fix to the GitLab Branch Source plugin here: https://github.com/jenkinsci/gitlab-branch-source-plugin/pull/469 In addition, I also submitted the following fix https://github.com/jenkinsci/multibranch-build-strategy-extension-plugin/pull/52 to this plugin that addresses https://issues.jenkins.io/browse/JENKINS-67128 and https://issues.jenkins.io/browse/JENKINS-60882

            igalg Igal Gluh
            brendanh Brendan Holmes
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: