branch-api: Support skip-rate-limit param

Change-Id: I4d86b24519381cc76e669f89d8e313f9c30ad999
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
This commit is contained in:
tanhengyeow 2018-08-09 18:04:16 +08:00
parent b23394b47b
commit 2d80dd00d4
4 changed files with 6 additions and 0 deletions

View File

@ -302,6 +302,8 @@ def branch_api(registry, xml_parent, data):
of builds will be enforced. (default 'Hour')
:valid values: **Hour**, **Day**, **Week**, **Month**, **Year**
:arg bool skip-rate-limit: Permit user triggered builds to
skip the rate limit (default false)
Minimal Example:
@ -324,6 +326,7 @@ def branch_api(registry, xml_parent, data):
mapping = [
('time-period', 'durationName', 'Hour', valid_time_periods),
('number-of-builds', 'count', 1),
('skip-rate-limit', 'userBoost', False),
]
helpers.convert_mapping_to_xml(branch, data, mapping, fail_required=True)

View File

@ -4,6 +4,7 @@
<jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl plugin="branch-api">
<durationName>Day</durationName>
<count>5</count>
<userBoost>true</userBoost>
</jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl>
</properties>
</project>

View File

@ -2,3 +2,4 @@ properties:
- branch-api:
time-period: Day
number-of-builds: 5
skip-rate-limit: true

View File

@ -4,6 +4,7 @@
<jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl plugin="branch-api">
<durationName>Hour</durationName>
<count>1</count>
<userBoost>false</userBoost>
</jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl>
</properties>
</project>