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:
parent
15b46e316f
commit
59317562ec
@ -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),
|
||||
|
10
tests/properties/fixtures/branch-api-minute.xml
Normal file
10
tests/properties/fixtures/branch-api-minute.xml
Normal 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>
|
4
tests/properties/fixtures/branch-api-minute.yaml
Normal file
4
tests/properties/fixtures/branch-api-minute.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
properties:
|
||||
- branch-api:
|
||||
time-period: Minute
|
||||
number-of-builds: 3
|
Loading…
Reference in New Issue
Block a user