From 2ea9841a9696d7e8c7cc9281dfd8de4498926090 Mon Sep 17 00:00:00 2001 From: Waldemar Znoinski Date: Fri, 6 Dec 2019 12:43:44 +0000 Subject: [PATCH] Add support for noSquash (no-squash) in jms-messaging trigger It's sometimes required to trigger a job build on every CI message. To achieve that the XML's noSquash (jjb: no-squash) has to be set to True. see triggers section at: https://wiki.jenkins.io/display/JENKINS/JMS+Messaging+Plugin Change-Id: I389e59cca4f649379614f7f6247bf76cf4a0ba95 --- jenkins_jobs/modules/triggers.py | 7 +++++++ tests/triggers/fixtures/jms-messaging001.xml | 1 + tests/triggers/fixtures/jms-messaging001.yaml | 1 + tests/triggers/fixtures/jms-messaging002.xml | 1 + 4 files changed, 10 insertions(+) diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index 21d9a7a39..c8b6b715e 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -933,6 +933,12 @@ def jms_messaging(registry, xml_parent, data): Requires the Jenkins :jenkins-wiki:`JMS Messaging Plugin `. + :arg bool no-squash: true = schedule a new job for every triggering message. + (default false) + Normally if a job is queued and another triggering message is received, a new job + is not submitted and the job is "squashed" into the job already queued. + Setting this option to 'True' forces a new job to be submitted for every triggering + message that is received. :arg str override-topic: If you need to override the default topic. (default '') :arg str selector: The JSON or YAML formatted text that conforms to @@ -968,6 +974,7 @@ def jms_messaging(registry, xml_parent, data): mapping = [ # option, xml name, default value ("spec", "spec", ""), + ("no-squash", "noSquash", False), ("selector", "selector", ""), ("provider-name", "providerName", ""), ] diff --git a/tests/triggers/fixtures/jms-messaging001.xml b/tests/triggers/fixtures/jms-messaging001.xml index 3d1e91e6e..02ac8aa8d 100644 --- a/tests/triggers/fixtures/jms-messaging001.xml +++ b/tests/triggers/fixtures/jms-messaging001.xml @@ -3,6 +3,7 @@ + true topic = "org.fedoraproject.prod.fedimg.image.upload" fedmsg diff --git a/tests/triggers/fixtures/jms-messaging001.yaml b/tests/triggers/fixtures/jms-messaging001.yaml index 2e9d4b776..b93b401f9 100644 --- a/tests/triggers/fixtures/jms-messaging001.yaml +++ b/tests/triggers/fixtures/jms-messaging001.yaml @@ -1,5 +1,6 @@ triggers: - jms-messaging: + no-squash: True selector: topic = "org.fedoraproject.prod.fedimg.image.upload" provider-name: fedmsg checks: diff --git a/tests/triggers/fixtures/jms-messaging002.xml b/tests/triggers/fixtures/jms-messaging002.xml index 4bc5ad6ad..a73fb8b1e 100644 --- a/tests/triggers/fixtures/jms-messaging002.xml +++ b/tests/triggers/fixtures/jms-messaging002.xml @@ -3,6 +3,7 @@ + false topic = "org.fedoraproject.prod.fedimg.image.upload" fedmsg