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

              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: