Second & Minute are now supported by branch-api

Since version 2.5.3 the branch-api plugin allows users to specify Minute
and Second as the time period for rate limiting.

Task: 42803
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
Change-Id: Id3558d818e2927ecc3d775870ad1929f0fda2e6f
This commit is contained in:
Bracken Dawson 2021-07-09 13:06:38 +01:00
parent 15b46e316f
commit 59317562ec
No known key found for this signature in database
GPG Key ID: 0A29122E6FE51E41
3 changed files with 16 additions and 2 deletions

View File

@ -383,7 +383,7 @@ def branch_api(registry, xml_parent, data):
:arg str time-period: The time period within which the maximum number
of builds will be enforced. (default 'Hour')
:valid values: **Hour**, **Day**, **Week**, **Month**, **Year**
:valid values: **Second** **Minute** **Hour**, **Day**, **Week**, **Month**, **Year**
:arg bool skip-rate-limit: Permit user triggered builds to
skip the rate limit (default false)
@ -404,7 +404,7 @@ def branch_api(registry, xml_parent, data):
)
branch.set("plugin", "branch-api")
valid_time_periods = ["Hour", "Day", "Week", "Month", "Year"]
valid_time_periods = ["Second", "Minute", "Hour", "Day", "Week", "Month", "Year"]
mapping = [
("time-period", "durationName", "Hour", valid_time_periods),

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl plugin="branch-api">
<durationName>Minute</durationName>
<count>3</count>
<userBoost>false</userBoost>
</jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl>
</properties>
</project>

View File

@ -0,0 +1,4 @@
properties:
- branch-api:
time-period: Minute
number-of-builds: 3