From 2d80dd00d49397563f111123b7dea5823d76877d Mon Sep 17 00:00:00 2001 From: tanhengyeow Date: Thu, 9 Aug 2018 18:04:16 +0800 Subject: [PATCH] branch-api: Support skip-rate-limit param Change-Id: I4d86b24519381cc76e669f89d8e313f9c30ad999 Signed-off-by: Tan Heng Yeow --- jenkins_jobs/modules/properties.py | 3 +++ tests/properties/fixtures/branch-api-full.xml | 1 + tests/properties/fixtures/branch-api-full.yaml | 1 + tests/properties/fixtures/branch-api-minimal.xml | 1 + 4 files changed, 6 insertions(+) diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index 59b6b1a96..9b5caaeb3 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -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) diff --git a/tests/properties/fixtures/branch-api-full.xml b/tests/properties/fixtures/branch-api-full.xml index e919921e5..90832bac1 100644 --- a/tests/properties/fixtures/branch-api-full.xml +++ b/tests/properties/fixtures/branch-api-full.xml @@ -4,6 +4,7 @@ Day 5 + true diff --git a/tests/properties/fixtures/branch-api-full.yaml b/tests/properties/fixtures/branch-api-full.yaml index 0b73a0e7b..6adc44c71 100644 --- a/tests/properties/fixtures/branch-api-full.yaml +++ b/tests/properties/fixtures/branch-api-full.yaml @@ -2,3 +2,4 @@ properties: - branch-api: time-period: Day number-of-builds: 5 + skip-rate-limit: true diff --git a/tests/properties/fixtures/branch-api-minimal.xml b/tests/properties/fixtures/branch-api-minimal.xml index 23e29ded4..f483478f7 100644 --- a/tests/properties/fixtures/branch-api-minimal.xml +++ b/tests/properties/fixtures/branch-api-minimal.xml @@ -4,6 +4,7 @@ Hour 1 + false