[JIRA] (JENKINS-55190) Support "List of parameters to check" in Throttle Concurrent Builds Plugin

1 view
Skip to first unread message

marcin.kielar@gmail.com (JIRA)

unread,
Dec 13, 2018, 3:33:02 PM12/13/18
to jenkinsc...@googlegroups.com
Marcin Kielar created an issue
 
Jenkins / New Feature JENKINS-55190
Support "List of parameters to check" in Throttle Concurrent Builds Plugin
Issue Type: New Feature New Feature
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 2018-12-13 20:32
Priority: Minor Minor
Reporter: Marcin Kielar

This ticket is to allow specification of limitOneJobWithMatchingParams and paramsToUseForLimit parameters in hudson.plugins.throttleconcurrents.ThrottleJobProperty.

Currently this is not possible, and users are required to use the configuration block as a workaround:

    concurrentBuild(true)
    throttleConcurrentBuilds {
        // Tune this number to control the total number of simultaneous
        // retirements across all environments.  This does not accurately
        // throttle per environment, but we expect the vast majority of
        // retirement requests to come in through prod, so it's good enough for
        // now.
        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/throttle-concurrent-builds-plugin/blob/master/src/main/java/hudson/plugins/throttleconcurrents/ThrottleJobProperty.java#L78-L79

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

marcin.kielar@gmail.com (JIRA)

unread,
Dec 13, 2018, 3:34:02 PM12/13/18
to jenkinsc...@googlegroups.com
Marcin Kielar updated an issue
Change By: Marcin Kielar
This ticket is to allow specification of {{limitOneJobWithMatchingParams}} and {{paramsToUseForLimit}} parameters in {{hudson.plugins.throttleconcurrents.ThrottleJobProperty}}.


Currently this is not possible, and users are required to use the configuration block as a workaround:

{code:java}
    concurrentBuild(true)
    throttleConcurrentBuilds {
        // Tune this number to control the total number of simultaneous
        // retirements across all environments.  This does not accurately
        // throttle per environment, but we expect the vast majority of
        // retirement requests to come in through prod, so it's good enough for
        // now.
        maxTotal(4)
    }
    configure { project ->
        project / 'properties' / 'hudson.plugins.throttleconcurrents.ThrottleJobProperty' <<
            'paramsToUseForLimit'('ENVIRONMENT,RETIREMENT_USERNAME')
        project / 'properties' / 'hudson.plugins.throttleconcurrents.ThrottleJobProperty' <<
            'limitOneJobWithMatchingParams'('true')
}
{code}

marcin.kielar@gmail.com (JIRA)

unread,
Dec 13, 2018, 3:34:02 PM12/13/18
to jenkinsc...@googlegroups.com
Marcin Kielar updated an issue
This ticket is to allow specification of {{limitOneJobWithMatchingParams}} and {{paramsToUseForLimit}} parameters in {{hudson.plugins.throttleconcurrents.ThrottleJobProperty}}.

Currently this is not possible, and users are required to use the configuration block as a workaround:

{code:java}
    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')
}
{code}
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/throttle-concurrent-builds-plugin/blob/master/src/main/java/hudson/plugins/throttleconcurrents/ThrottleJobProperty.java#L78-L79

marcin.kielar@gmail.com (JIRA)

unread,
Dec 13, 2018, 3:35:02 PM12/13/18
to jenkinsc...@googlegroups.com
Marcin Kielar updated an issue
This ticket 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:

{code:java}
    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')
    }
{code}
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/throttle-concurrent-builds-plugin/blob/master/src/main/java/hudson/plugins/throttleconcurrents/ThrottleJobProperty.java#L78-L79

marcin.kielar@gmail.com (JIRA)

unread,
Dec 13, 2018, 3:35:02 PM12/13/18
to jenkinsc...@googlegroups.com
Marcin Kielar updated an issue
This ticket 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:

{code:java}
    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')
    }
{code}
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/throttle-concurrent-builds-plugin/blob/master/src/main/java/hudson/plugins/throttleconcurrents/ThrottleJobProperty.java#L78-L79

marcin.kielar@gmail.com (JIRA)

unread,
Dec 13, 2018, 3:40:01 PM12/13/18
to jenkinsc...@googlegroups.com
Marcin Kielar updated an issue
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:

{code:java}
    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')
    }
{code}
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

mail@daniel-spilker.com (JIRA)

unread,
Jan 4, 2019, 3:57:01 PM1/4/19
to jenkinsc...@googlegroups.com
Daniel Spilker closed an issue as Fixed
 

This is already supported by the Dynamic DSL:

job('example') {
  properties {
    throttleJobProperty {
      limitOneJobWithMatchingParams(true)
      paramsToUseForLimit('TEST')
    }
  }
} 
Change By: Daniel Spilker
Status: Open Closed
Resolution: Fixed

mail@daniel-spilker.com (JIRA)

unread,
Jan 4, 2019, 3:57:01 PM1/4/19
to jenkinsc...@googlegroups.com

job('example') {
  properties {
    throttleJobProperty {
      maxConcurrentTotal(4)
      limitOneJobWithMatchingParams(true)
      paramsToUseForLimit('TEST')
    }
  }
}
{code}

uwe.hanisch@gmx.de (JIRA)

unread,
Feb 5, 2019, 11:47:02 AM2/5/19
to jenkinsc...@googlegroups.com
Uwe Hanisch reopened an issue
 

job-dsl-plugin should support the configuration of following two Throttle Concurrent Build parameters

  • boolean limitOneJobWithMatchingParams
  • String paramsToUseForLimit

These parameters were introduced with Throttle Concurrent Build version 1.8.5

Files which needed to adjust:

Change By: Uwe Hanisch
Resolution: Fixed
Status: Closed Reopened

uwe.hanisch@gmx.de (JIRA)

unread,
Feb 5, 2019, 12:13:03 PM2/5/19
to jenkinsc...@googlegroups.com
Uwe Hanisch edited a comment on New Feature JENKINS-55190
 
Re: Support "List of parameters to check" in Throttle Concurrent Builds Plugin
It is confusing the diffence between build in and dynamic DSL.

Nonetheless
job-dsl-plugin should support the configuration of following two Throttle Concurrent Build parameters natively:
-  boolean limitOneJobWithMatchingParams
-  String paramsToUseForLimit

These
two parameters were introduced with Throttle Concurrent Build version 1.8.5


Files which needed to adjust:
*   Code
** [job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy#L84]


** [job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/toplevel/ThrottleConcurrentBuildsContext.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/toplevel/ThrottleConcurrentBuildsContext.groovy]
* examples
** [job-dsl-core/src/main/docs/examples/javaposse/jobdsl/dsl/Job/throttleConcurrentBuilds.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/docs/examples/javaposse/jobdsl/dsl/Job/throttleConcurrentBuilds.groovy]
* Tests
**  [job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/JobSpec.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/JobSpec.groovy#L340]
**  [job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/jobs/MatrixJobSpec.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/jobs/MatrixJobSpec.groovy#L102]

uwe.hanisch@gmx.de (JIRA)

unread,
Feb 5, 2019, 12:14:02 PM2/5/19
to jenkinsc...@googlegroups.com
Uwe Hanisch edited a comment on New Feature JENKINS-55190
It is confusing the diffence The difference between build in and dynamic DSL is confusing .

Nonetheless job-dsl-plugin should support the configuration of
the following two Throttle Concurrent Build parameters natively:

- boolean limitOneJobWithMatchingParams
- String paramsToUseForLimit

These two parameters were introduced with Throttle Concurrent Build version 1.8.5

Files which needed to adjust:
* Code
** [job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy#L84]
** [job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/toplevel/ThrottleConcurrentBuildsContext.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/toplevel/ThrottleConcurrentBuildsContext.groovy]
* examples
** [job-dsl-core/src/main/docs/examples/javaposse/jobdsl/dsl/Job/throttleConcurrentBuilds.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/docs/examples/javaposse/jobdsl/dsl/Job/throttleConcurrentBuilds.groovy]
* Tests
** [job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/JobSpec.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/JobSpec.groovy#L340]
** [job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/jobs/MatrixJobSpec.groovy|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/jobs/MatrixJobSpec.groovy#L102]

uwe.hanisch@gmx.de (JIRA)

unread,
Feb 6, 2019, 10:37:02 AM2/6/19
to jenkinsc...@googlegroups.com

mail@daniel-spilker.com (JIRA)

unread,
Mar 22, 2019, 10:58:02 AM3/22/19
to jenkinsc...@googlegroups.com
Daniel Spilker updated New Feature JENKINS-55190
 

The built-in DSL is in Maintenance Mode. If a feature is available in Dynamic DSL, it will not be supported by the built-in DSL.

Change By: Daniel Spilker
Status: Reopened Fixed but Unreleased
Resolution: Won't Fix

mail@daniel-spilker.com (JIRA)

unread,
Mar 11, 2020, 9:23:03 AM3/11/20
to jenkinsc...@googlegroups.com
Change By: Daniel Spilker
Status: Fixed but Unreleased Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages