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
            johnstosh John Muczynski added a comment -

            Ah, okay, as Jesse commented on the other issue: "Nothing to do with Declarative vs. Scripted, only multibranch vs. standalone."

             

            options {
                buildDiscarder(logRotator(numToKeepStr: '90', artifactNumToKeepStr: '5'))
                retry(1)
                skipDefaultCheckout()
                disableConcurrentBuilds()
                quietPeriod(600)
            }

             
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: 350: Invalid option type "quietPeriod". Valid option types: [buildDiscarder, catchError, disableConcurrentBuilds, overrideIndexTriggers, retry, script, skipDefaultCheckout, skipStagesAfterUnstable, timeout, timestamps, waitUntil, withContext, withCredentials, withEnv, ws] @ line 350, column 9.
            quietPeriod(600)
            ^

            General error during semantic analysis: There's no @DataBoundConstructor on any constructor of class jenkins.model.GlobalQuietPeriodConfiguration

            org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class jenkins.model.GlobalQuietPeriodConfiguration
            at org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:265)
            at org.jenkinsci.plugins.structs.describable.DescribableModel.<init>(DescribableModel.java:122)

            Show
            johnstosh John Muczynski added a comment - Ah, okay, as Jesse commented on the other issue: "Nothing to do with Declarative vs. Scripted, only multibranch vs. standalone."   options { buildDiscarder(logRotator(numToKeepStr: '90', artifactNumToKeepStr: '5')) retry(1) skipDefaultCheckout() disableConcurrentBuilds() quietPeriod(600) }   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 350: Invalid option type "quietPeriod". Valid option types: [buildDiscarder, catchError, disableConcurrentBuilds, overrideIndexTriggers, retry, script, skipDefaultCheckout, skipStagesAfterUnstable, timeout, timestamps, waitUntil, withContext, withCredentials, withEnv, ws] @ line 350, column 9. quietPeriod(600) ^ General error during semantic analysis: There's no @DataBoundConstructor on any constructor of class jenkins.model.GlobalQuietPeriodConfiguration org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class jenkins.model.GlobalQuietPeriodConfiguration at org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:265) at org.jenkinsci.plugins.structs.describable.DescribableModel.<init>(DescribableModel.java:122)
            Hide
            johnstosh John Muczynski added a comment -

            Ooph, my bad.  I didn't make sure to update Declarative to version 1.3.2

            It looks like it is accepting the quietPeriod now, after updating blue ocean.

            Show
            johnstosh John Muczynski added a comment - Ooph, my bad.  I didn't make sure to update Declarative to version 1.3.2 It looks like it is accepting the quietPeriod now, after updating blue ocean.
            Hide
            yanstoic753 Yan Corneille added a comment -

            As noticed by Jesse Glick comment-350957 this does not seem to be available in Scripted pipelines. Are there any plans for that ?

            Show
            yanstoic753 Yan Corneille added a comment - As noticed by Jesse Glick  comment-350957 this does not seem to be available in Scripted pipelines. Are there any plans for that ?
            Hide
            ogmueller Oliver Mueller added a comment - - edited

            We are using Jenkins 2.195, Multibranch 2.21 and Declarative version 1.3.9.

            Option quietPeriod seems to be accepted, but it does NOT seem to work.

            We are using a declarative multibranch pipeline with these options: 

            pipeline {
              agent any
              options {
                quietPeriod 1200
                timeout(time: 4, unit: 'HOURS')
                disableConcurrentBuilds()
              }
            ...

            The pipeline will get executed immediately.

            Show
            ogmueller Oliver Mueller added a comment - - edited We are using Jenkins 2.195, Multibranch 2.21 and Declarative version 1.3.9. Option quietPeriod seems to be accepted, but it does NOT seem to work. We are using a declarative multibranch pipeline with these options:  pipeline { agent any options { quietPeriod 1200 timeout(time: 4, unit: 'HOURS' ) disableConcurrentBuilds() } ... The pipeline will get executed immediately.
            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.    

              People

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

                Dates

                • Created:
                  Updated: