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

Multibranch pipeline does not allow quiet time or throttle

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: branch-api-plugin
    • Labels:
      None
    • Environment:
      Running jenkins 2.15 with pipeline-multibranch 2.8.
    • Similar Issues:

      Description

      Currently, for an individual pipeline job I can set a quiet time to avoid one-for-one commit-to-build ratio when there are many commits in a short time. I like to use the multibranch plugin to allow branch automation, but there does not appear to be a way for a multibranch config (either the meta-job itself or from within a Jenkinsfile) to define a quiet time or some other ability to throttle job runs.

        Attachments

          Issue Links

            Activity

            Hide
            javi_martin Javi Martin added a comment -

            we are facing the same problem (Jenkins 2.190.1, Multibranch 2.21 and Declarative 1.3.9).

            The quietPeriod option seems to be working when calling the job from another job by sending the branch name in the URL "/projects/Build-MultibranchProject/master", but it does not work when the webhook calls the Multibranch project. 

            Multibranch plugin seems to be executing the required branch job doing a "Build now" and it bypasses the quietPeriod options.

             

             

            Show
            javi_martin Javi Martin added a comment - we are facing the same problem (Jenkins 2.190.1, Multibranch 2.21 and Declarative 1.3.9). The quietPeriod option seems to be working when calling the job from another job by sending the branch name in the URL "/projects/Build-MultibranchProject/master", but it does not work when the webhook calls the Multibranch project.  Multibranch plugin seems to be executing the required branch job doing a "Build now" and it bypasses the quietPeriod options.    
            Hide
            vincenzo_cerbone vincenzo cerbone added a comment -

            Successfully tested with Declarative (Jenkins 2.200) but had no luck to set it in Scripted fashion. As someone stated before, there's no way neither to get it generated with pipeline-syntax generator, nor trying something like this:

            properties([
                pipelineTriggers([
            				[
            					$class: 'HudsonStartupTrigger',
            					quietPeriod: '2'
            				]
            			])
            ])
            

            will produce:

             no known implementation of class hudson.triggers.Trigger is named HudsonStartupTrigger
            
            Show
            vincenzo_cerbone vincenzo cerbone added a comment - Successfully tested with Declarative (Jenkins 2.200) but had no luck to set it in Scripted fashion. As someone stated before, there's no way neither to get it generated with pipeline-syntax generator, nor trying something like this: properties([ pipelineTriggers([ [ $class: 'HudsonStartupTrigger' , quietPeriod: '2' ] ]) ]) will produce: no known implementation of class hudson.triggers.Trigger is named HudsonStartupTrigger
            Hide
            addib Dibakar Aditya added a comment - - edited

            vincenzo cerbone, did you see any success using this in a multibranch pipeline project? In our setup, the Declarative syntax with standalone pipeline project works as intended, but not in multibranch yet. This functionality is much needed, especially with the maven release plugin.

            Show
            addib Dibakar Aditya added a comment - - edited vincenzo cerbone , did you see any success using this in a multibranch pipeline project? In our setup, the Declarative syntax with standalone pipeline project works as intended, but not in multibranch yet. This functionality is much needed, especially with the maven release plugin.
            Hide
            vincenzo_cerbone vincenzo cerbone added a comment -

            Dibakar Aditya I tested it (Declarative) in multibranch as Oliver Mueller reported and I had luck to see it working. Unfortunately I needed it to work in scripted mode because JTE (Jenking Template Engine) does not support Declarative.
            I ended up using this instruction and it works!

            }}{{currentBuild.rawBuild.getParent().setQuietPeriod(10){{}}

            About maven-release-plugin, I prefer not to use it anymor. Now I'm using :
            https://github.com/aleksandr-m/gitflow-maven-plugin{{}}

            Show
            vincenzo_cerbone vincenzo cerbone added a comment - Dibakar Aditya I tested it (Declarative) in multibranch as Oliver Mueller reported and I had luck to see it working. Unfortunately I needed it to work in scripted mode because JTE (Jenking Template Engine) does not support Declarative. I ended up using this instruction and it works! }}{{currentBuild.rawBuild.getParent().setQuietPeriod(10) {{}} About maven-release-plugin, I prefer not to use it anymor. Now I'm using : https://github.com/aleksandr-m/gitflow-maven-plugin {{}}
            Hide
            addib Dibakar Aditya added a comment - - edited

            vincenzo cerbone, I have tried both the Declarative and Scripted approach that you suggested on Jenkins 2.204.1 with the latest version of plugins. Though I can see the quiet period being set in the job configuration page of the branch, multibranch still chooses to ignore it.

            Show
            addib Dibakar Aditya added a comment - - edited vincenzo cerbone , I have tried both the Declarative and Scripted approach that you suggested on Jenkins 2.204.1 with the latest version of plugins. Though I can see the quiet period being set in the job configuration page of the branch, multibranch still chooses to ignore it.

              People

              • Assignee:
                Unassigned
                Reporter:
                bsipos Brian Sipos
              • Votes:
                48 Vote for this issue
                Watchers:
                52 Start watching this issue

                Dates

                • Created:
                  Updated: