-
New Feature
-
Resolution: Won't Fix
-
Minor
-
None
This request is to allow specification of limitOneJobWithMatchingParams and paramsToUseForLimit parameters in hudson.plugins.throttleconcurrents.ThrottleJobProperty, when using throttleConcurrentBuilds directive in Job DSL Plugin.
Currently this is not possible, and users are required to use the configuration block as a workaround:
concurrentBuild(true) throttleConcurrentBuilds { maxTotal(4) } configure { project -> project / 'properties' / 'hudson.plugins.throttleconcurrents.ThrottleJobProperty' << 'paramsToUseForLimit'('ENVIRONMENT,RETIREMENT_USERNAME') project / 'properties' / 'hudson.plugins.throttleconcurrents.ThrottleJobProperty' << 'limitOneJobWithMatchingParams'('true') }
Full example here: https://github.com/edx/jenkins-job-dsl/blob/master/platform/jobs/RetirementJobs.groovy#L93-L107
I think the file where this could be modified is here:
https://github.com/jenkinsci/job-dsl-plugin/blob/e5925eb643a0024cf58fac34dd5bf2c6455f8d4b/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy#L88-L108
And the implementation in Throttle Concurrent Builds Plugin:
https://github.com/jenkinsci/throttle-concurrent-builds-plugin/blob/master/src/main/java/hudson/plugins/throttleconcurrents/ThrottleJobProperty.java#L78-L79