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

Multibranch pipeline (re)creation intelligence

      When a multibranch pipeline is created or recreated, it instantly pulls in all the branches at once and starts initial builds on them.

      Could we have a way to limit the number of builds which happen right at branch creation? Something user configurable would be great.

          [JENKINS-38552] Multibranch pipeline (re)creation intelligence

          The PRs which address this issue are...

          https://github.com/jenkinsci/branch-api-plugin/pull/144
          https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/4

          Cross fingers this does not break anything xD

          Félix Belzunce Arcos added a comment - The PRs which address this issue are... https://github.com/jenkinsci/branch-api-plugin/pull/144 https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/4 Cross fingers this does not break anything xD

          chirs damour added a comment -

          can i use this to workaround JENKINS-56318 ?

          chirs damour added a comment - can i use this to workaround  JENKINS-56318  ?

          Alex Taylor added a comment -

          drdamour Yeah that would work since this configuration item will ignore that first default build which happens and therefore should not trigger the multibranch twice.

          I wold worry it would not work since there does not seem to be an actual cause for the other ticket but it would at least stop the first build

          Alex Taylor added a comment - drdamour Yeah that would work since this configuration item will ignore that first default build which happens and therefore should not trigger the multibranch twice. I wold worry it would not work since there does not seem to be an actual cause for the other ticket but it would at least stop the first build

          chirs damour added a comment -

          the cause for the other ticket is cause two hooks are received, one at repo level one at org level.

          chirs damour added a comment - the cause for the other ticket is cause two hooks are received, one at repo level one at org level.

          Alex Taylor added a comment -

          drdamour If that is the case then this feature will not work as a workaround. The webhook triggering still happens normally there is just not an initial build which normally happens automatically without the intervention of a webhook

          Alex Taylor added a comment - drdamour If that is the case then this feature will not work as a workaround. The webhook triggering still happens normally there is just not an initial build which normally happens automatically without the intervention of a webhook

          chirs damour added a comment -

          i think this change might have caused a bug. after upgrading our jobs aren't running any more at all.

          chirs damour added a comment - i think this change might have caused a bug. after upgrading our jobs aren't running any more at all.

          chirs damour added a comment -
          SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.MultiBranchProject$SCMEventListenerImpl@1cf8cddc propagated an exception
          java.lang.AbstractMethodError: jenkins.branch.BranchBuildStrategy.isAutomaticBuild(Ljenkins/scm/api/SCMSource;Ljenkins/scm/api/SCMHead;Ljenkins/scm/api/SCMRevision;Ljenkins/scm/api/SCMRevision;Lhudson/model/TaskListener;)Z
          	at jenkins.branch.buildstrategies.basic.AllBranchBuildStrategyImpl.isAutomaticBuild(AllBranchBuildStrategyImpl.java:77)
          	at jenkins.branch.BranchBuildStrategy.automaticBuild(BranchBuildStrategy.java:190)
          	at jenkins.branch.MultiBranchProject.isAutomaticBuild(MultiBranchProject.java:2231)
          	at jenkins.branch.MultiBranchProject.access$1200(MultiBranchProject.java:125)
          	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2076)
          	at jenkins.scm.api.SCMHeadObserver$Wrapped.observe(SCMHeadObserver.java:638)
          	at jenkins.scm.api.SCMHeadEvent$Validated.observe(SCMHeadEvent.java:295)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:917)
          	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
          	at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadUpdate(MultiBranchProject.java:1576)
          	at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1177)
          	at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246)
          	at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229)
          	at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:479)
          	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
          	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)
          

          chirs damour added a comment - SCMEventListener.onSCMHeadEvent(SCMHeadEvent) jenkins.branch.MultiBranchProject$SCMEventListenerImpl@1cf8cddc propagated an exception java.lang.AbstractMethodError: jenkins.branch.BranchBuildStrategy.isAutomaticBuild(Ljenkins/scm/api/SCMSource;Ljenkins/scm/api/SCMHead;Ljenkins/scm/api/SCMRevision;Ljenkins/scm/api/SCMRevision;Lhudson/model/TaskListener;)Z at jenkins.branch.buildstrategies.basic.AllBranchBuildStrategyImpl.isAutomaticBuild(AllBranchBuildStrategyImpl.java:77) at jenkins.branch.BranchBuildStrategy.automaticBuild(BranchBuildStrategy.java:190) at jenkins.branch.MultiBranchProject.isAutomaticBuild(MultiBranchProject.java:2231) at jenkins.branch.MultiBranchProject.access$1200(MultiBranchProject.java:125) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2076) at jenkins.scm.api.SCMHeadObserver$Wrapped.observe(SCMHeadObserver.java:638) at jenkins.scm.api.SCMHeadEvent$Validated.observe(SCMHeadEvent.java:295) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:917) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadUpdate(MultiBranchProject.java:1576) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1177) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:246) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:229) at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:479) at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745)

          chirs damour added a comment -

          yeah this change wasn't done in a backwards compatible way for the any/all/none strategies https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/4/files#r274398090

          chirs damour added a comment - yeah this change wasn't done in a backwards compatible way for the any/all/none strategies  https://github.com/jenkinsci/basic-branch-build-strategies-plugin/pull/4/files#r274398090

          drdamour can you file an issue the AbstractMethodError and assign to  fbelzunc as this is another fire he needs to put out

          Stephen Connolly added a comment - drdamour can you file an issue the AbstractMethodError and assign to   fbelzunc as this is another fire he needs to put out

          chirs damour added a comment -

          chirs damour added a comment - JENKINS-56984

            fbelzunc Félix Belzunce Arcos
            ataylor Alex Taylor
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: