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

Snippet generator: Wrong snippet for Throttle Build

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: structs-plugin
    • Labels:
      None
    • Environment:
      Jenkins LTS 2.32.2
      branch-api:1.11.1 'Branch API Plugin'
      workflow-aggregator:2.4 'Pipeline'
    • Similar Issues:

      Description

      In the snippet generator, the following configuration... 

       

       

      ... returns:

       

      properties([[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false], 
      [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'], 
      [$class: 'JobPropertyImpl', throttle: [count: 1, durationName: 'hour']],
      pipelineTriggers([])])

       

      In the console output after running that snippet, it returns:

       

      ... Caused by: java.lang.UnsupportedOperationException: JobPropertyImpl as a class hudson.model.JobProperty could mean either jenkins.branch.RateLimitBranchProperty$JobPropertyImpl or com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl ... Finished: FAILURE

       

      It is failing in recognized JobPropertyImpl 

      Workaround: change the above snippet for the following one which works:

      properties([[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false], 
      [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'], 
      [$class: 'jenkins.branch.RateLimitBranchProperty$JobPropertyImpl', throttle: [count: 2, durationName: 'day']],
      pipelineTriggers([])])

       

        Attachments

          Issue Links

            Activity

            carlosrodlop Carlos Rodríguez López created issue -
            carlosrodlop Carlos Rodríguez López made changes -
            Field Original Value New Value
            Description In the snippet generator, the following configuration... 

             

            !001-2017-03-15 15_18_58-Pipeline Syntax_ Snippet Generator [Jenkins].png!

             

            ... returns:

             
            {code:java}
            properties([[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
            [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'],
            [$class: 'JobPropertyImpl', throttle: [count: 1, durationName: 'hour']],
            pipelineTriggers([])]){code}
             

            After running that snippet, the console output returns

             

            {{... Caused by: java.lang.UnsupportedOperationException: JobPropertyImpl as a class hudson.model.JobProperty could mean either jenkins.branch.RateLimitBranchProperty$JobPropertyImpl or com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl ... Finished: FAILURE}}

             

            It is failing in recognized {{JobPropertyImpl}} 

            Workaround: change the above snippet for the following one which works:
            {code:java}
            properties([[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
            [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'],
            [$class: 'jenkins.branch.RateLimitBranchProperty$JobPropertyImpl', throttle: [count: 2, durationName: 'day']],
            pipelineTriggers([])]){code}
             
            In the +snippet generator+, the following configuration... 

             

            !001-2017-03-15 15_18_58-Pipeline Syntax_ Snippet Generator [Jenkins].png!

             

            ... returns:

             
            {code:java}
            properties([[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
            [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'],
            [$class: 'JobPropertyImpl', throttle: [count: 1, durationName: 'hour']],
            pipelineTriggers([])]){code}
             

            In the +console output+ after running that snippet, it returns:

             
            {code:java}
            ... Caused by: java.lang.UnsupportedOperationException: JobPropertyImpl as a class hudson.model.JobProperty could mean either jenkins.branch.RateLimitBranchProperty$JobPropertyImpl or com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl ... Finished: FAILURE{code}
             

            It is failing in recognized {{JobPropertyImpl}} 

            Workaround: change the above snippet for the following one which works:
            {code:java}
            properties([[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
            [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'],
            [$class: 'jenkins.branch.RateLimitBranchProperty$JobPropertyImpl', throttle: [count: 2, durationName: 'day']],
            pipelineTriggers([])]){code}
             
            recampbell Ryan Campbell made changes -
            Component/s structs-plugin [ 21442 ]
            Component/s branch-api-plugin [ 18621 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Assignee Stephen Connolly [ stephenconnolly ] Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #17 (Web Link)" [ 15848 ]
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-32476 [ JENKINS-32476 ]
            stephenconnolly Stephen Connolly made changes -
            Link This issue is related to JENKINS-45130 [ JENKINS-45130 ]
            jamesdumay James Dumay made changes -
            Remote Link This issue links to "CloudBees Internal OSS-2151 (Web Link)" [ 18401 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                carlosrodlop Carlos Rodríguez López
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: