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

Possible regression: rateLimitBuilds() syntax not accepted

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: branch-api-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.235.5, all plugins at latest version as of 2020-09-02.
    • Similar Issues:

      Description

      I was trying to add a job that takes ~20 hours to run so I decided to limit it to one run per week, but if I use the suggested snippet properties([rateLimitBuilds([count: 1, durationName: 'week', userBoost: true])]) I get the following error and it's not applied:

      WARNING: Unknown parameter(s) found for class type 'jenkins.branch.RateLimitBranchProperty$JobPropertyImpl': count,durationName,userBoost

      Searching for other examples it appears that the correct syntax is rateLimitBuilds(throttle: [count: 1, durationName: 'week', userBoost: true]).

      I spent many hours trying to debug this error message and would appreciate it if the snippet generator was fixed (or the suggested syntax was also accepted) so that others don't also run into this issue.

      I feel like this syntax worked correctly in the past, so this might be a regression introduced in https://github.com/jenkinsci/branch-api-plugin/commit/97f7edb2af0a5dcba423ac70efeb9b9851b58524#diff-ca2ff61b92524e082e6ac9d90496948f ?

        Attachments

          Activity

          Hide
          sodul Stephane Odul added a comment - - edited

          I got the same problem:

          00:00:03.793  GitHub has been notified of this commit’s build result
          00:00:03.793  
          00:00:03.794  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          00:00:03.794  WorkflowScript: 51: Invalid parameter "count", did you mean "throttle"? @ line 51, column 26.
          00:00:03.794             rateLimitBuilds([count: 20, durationName: 'hour', userBoost: false])
          00:00:03.794                              ^
          00:00:03.794  
          00:00:03.794  WorkflowScript: 51: Invalid parameter "durationName", did you mean "throttle"? @ line 51, column 37.
          00:00:03.794             rateLimitBuilds([count: 20, durationName: 'hour', userBoost: false])
          00:00:03.794                                         ^
          00:00:03.794  
          00:00:03.794  WorkflowScript: 51: Invalid parameter "userBoost", did you mean "throttle"? @ line 51, column 59.
          00:00:03.794     nt: 20, durationName: 'hour', userBoost:
          00:00:03.794                                   ^
          00:00:03.794  
          00:00:03.794  3 errors 

           

          The declarative-linter linter is giving me the all clear with the same file.

          Show
          sodul Stephane Odul added a comment - - edited I got the same problem: 00:00:03.793 GitHub has been notified of this commit’s build result 00:00:03.793 00:00:03.794 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: 00:00:03.794 WorkflowScript: 51: Invalid parameter "count", did you mean "throttle"? @ line 51, column 26. 00:00:03.794 rateLimitBuilds([count: 20, durationName: 'hour', userBoost: false]) 00:00:03.794 ^ 00:00:03.794 00:00:03.794 WorkflowScript: 51: Invalid parameter "durationName", did you mean "throttle"? @ line 51, column 37. 00:00:03.794 rateLimitBuilds([count: 20, durationName: 'hour', userBoost: false]) 00:00:03.794 ^ 00:00:03.794 00:00:03.794 WorkflowScript: 51: Invalid parameter "userBoost", did you mean "throttle"? @ line 51, column 59. 00:00:03.794 nt: 20, durationName: 'hour', userBoost: 00:00:03.794 ^ 00:00:03.794 00:00:03.794 3 errors   The declarative-linter linter is giving me the all clear with the same file.

            People

            • Assignee:
              Unassigned
              Reporter:
              arichardson Alex Richardson
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: