summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2020-01-01 22:19:01 +0000
committerDavid Ostrovsky <david@ostrovsky.org>2020-01-08 21:58:12 +0100
commit979770380151f99ec7b48d7d6fbd8d8d254c752c (patch)
treec9975841cf1b77d47c551e7a0a14d3a91731488b /jenkins_jobs
parent99e9b234bc39f099000e4c819c560567176dc492 (diff)
downloadpython-jenkins-job-builder-979770380151f99ec7b48d7d6fbd8d8d254c752c.tar.gz
python-jenkins-job-builder-979770380151f99ec7b48d7d6fbd8d8d254c752c.tar.xz
python-jenkins-job-builder-979770380151f99ec7b48d7d6fbd8d8d254c752c.zip
Experimental support for filterChecks trait
The gerrit-code-review-plugin v0.4.0 introduces the integration with Gerrit Checks plugin. Introduce the option to query for pending checks. Change-Id: Idb3f290121aa6fbcdc25a0821c9bdc3dd03e21af
Diffstat (limited to 'jenkins_jobs')
-rw-r--r--jenkins_jobs/modules/project_multibranch.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/project_multibranch.py b/jenkins_jobs/modules/project_multibranch.py
index 2a7a3870..93c5bc38 100644
--- a/jenkins_jobs/modules/project_multibranch.py
+++ b/jenkins_jobs/modules/project_multibranch.py
@@ -569,6 +569,13 @@ def gerrit_scm(xml_parent, data):
(like to disable SCM triggering or to override the pipeline durability)
(optional)
Refer to :func:`~property_strategies <property_strategies>`.
+ :arg dict filter-checks: Enable the filtering by pending checks, allowing to
+ discover the changes that need validation only. This feature is using
+ the gerrit checks plugin.
+ (optional)
+ query-operator: Name of the query operator, supported values are:
+ 'SCHEME' or 'ID'.
+ query-string: Value of the query operator.
Minimal Example:
@@ -635,6 +642,20 @@ def gerrit_scm(xml_parent, data):
if data.get("build-strategies", None):
build_strategies(xml_parent, data)
+ # FilterChecks Trait
+ checks = data.get("filter-checks", None)
+ if checks:
+ checks_trait = XML.SubElement(
+ traits, "jenkins.plugins.gerrit.traits.FilterChecksTrait"
+ )
+ checks_source_mapping = [
+ ("query-operator", "queryOperator", None),
+ ("query-string", "queryString", None),
+ ]
+ helpers.convert_mapping_to_xml(
+ checks_trait, checks, checks_source_mapping, fail_required=True
+ )
+
def git_scm(xml_parent, data):
r"""Configure Git SCM