From ea324d31d2a6e4d9eabe8b2fbb4a8d8979784cb1 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 5 Feb 2018 13:07:31 +0000 Subject: [PATCH] gerrit-trigger: avoid exception spamming logs Adds empty triggerInformationAction section which when missing was generating recurring spam on Jenkins logs. included null not assignable to interface hudson.model.Action See https://issues.jenkins-ci.org/browse/JENKINS-45788 Change-Id: I97efbfcb17388b5ca99901aa35f4311c8db77710 --- jenkins_jobs/modules/triggers.py | 2 ++ tests/jsonparser/fixtures/complete001.xml | 1 + tests/triggers/fixtures/gerrit001.xml | 1 + tests/triggers/fixtures/gerrit002.xml | 1 + tests/triggers/fixtures/gerrit003.xml | 1 + tests/triggers/fixtures/gerrit004.xml | 1 + tests/triggers/fixtures/gerrit005.xml | 1 + tests/triggers/fixtures/gerrit006.xml | 1 + tests/triggers/fixtures/gerrit007.xml | 1 + tests/triggers/fixtures/gerrit008.xml | 1 + tests/triggers/fixtures/gerrit009.xml | 1 + tests/yamlparser/fixtures/complete001.xml | 1 + 12 files changed, 13 insertions(+) diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index e022b0d8d..ae8c5841e 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -575,6 +575,8 @@ def gerrit(registry, xml_parent, data): data.get('dynamic-trigger-enabled', False)) XML.SubElement(gtrig, 'triggerConfigURL').text = str( data.get('dynamic-trigger-url', '')) + XML.SubElement(gtrig, 'triggerInformationAction').text = str( + data.get('trigger-information-action', '')) XML.SubElement(gtrig, 'allowTriggeringUnreviewedPatches').text = str( data.get('trigger-for-unreviewed-patches', False)).lower() build_gerrit_triggers(gtrig, data) diff --git a/tests/jsonparser/fixtures/complete001.xml b/tests/jsonparser/fixtures/complete001.xml index 3b1893351..bbaaad0f4 100644 --- a/tests/jsonparser/fixtures/complete001.xml +++ b/tests/jsonparser/fixtures/complete001.xml @@ -74,6 +74,7 @@ False + false diff --git a/tests/triggers/fixtures/gerrit001.xml b/tests/triggers/fixtures/gerrit001.xml index 5d769f22c..5a30fcb37 100644 --- a/tests/triggers/fixtures/gerrit001.xml +++ b/tests/triggers/fixtures/gerrit001.xml @@ -37,6 +37,7 @@ True http://myhost/mytrigger + false diff --git a/tests/triggers/fixtures/gerrit002.xml b/tests/triggers/fixtures/gerrit002.xml index 9e6879007..d42eb2bb9 100644 --- a/tests/triggers/fixtures/gerrit002.xml +++ b/tests/triggers/fixtures/gerrit002.xml @@ -41,6 +41,7 @@ True http://myhost/mytrigger + false diff --git a/tests/triggers/fixtures/gerrit003.xml b/tests/triggers/fixtures/gerrit003.xml index 8e3549f13..55ef0e6fa 100644 --- a/tests/triggers/fixtures/gerrit003.xml +++ b/tests/triggers/fixtures/gerrit003.xml @@ -58,6 +58,7 @@ True http://myhost/mytrigger + false diff --git a/tests/triggers/fixtures/gerrit004.xml b/tests/triggers/fixtures/gerrit004.xml index d4d78e90a..324ad9add 100644 --- a/tests/triggers/fixtures/gerrit004.xml +++ b/tests/triggers/fixtures/gerrit004.xml @@ -47,6 +47,7 @@ ALL True http://myhost/mytrigger + true diff --git a/tests/triggers/fixtures/gerrit005.xml b/tests/triggers/fixtures/gerrit005.xml index 67ea3c43a..bb719e43a 100644 --- a/tests/triggers/fixtures/gerrit005.xml +++ b/tests/triggers/fixtures/gerrit005.xml @@ -37,6 +37,7 @@ False + false diff --git a/tests/triggers/fixtures/gerrit006.xml b/tests/triggers/fixtures/gerrit006.xml index ae693508b..30a9e5c34 100644 --- a/tests/triggers/fixtures/gerrit006.xml +++ b/tests/triggers/fixtures/gerrit006.xml @@ -37,6 +37,7 @@ True http://myhost/mytrigger + false diff --git a/tests/triggers/fixtures/gerrit007.xml b/tests/triggers/fixtures/gerrit007.xml index 335094b6e..821186ea9 100644 --- a/tests/triggers/fixtures/gerrit007.xml +++ b/tests/triggers/fixtures/gerrit007.xml @@ -47,6 +47,7 @@ True http://myhost/mytrigger + true diff --git a/tests/triggers/fixtures/gerrit008.xml b/tests/triggers/fixtures/gerrit008.xml index 4b9342de9..bd06843ac 100644 --- a/tests/triggers/fixtures/gerrit008.xml +++ b/tests/triggers/fixtures/gerrit008.xml @@ -53,6 +53,7 @@ ALL True http://myhost/mytrigger + true diff --git a/tests/triggers/fixtures/gerrit009.xml b/tests/triggers/fixtures/gerrit009.xml index f7ef95fcb..8abc6e438 100644 --- a/tests/triggers/fixtures/gerrit009.xml +++ b/tests/triggers/fixtures/gerrit009.xml @@ -19,6 +19,7 @@ True http://myhost/mytrigger + false diff --git a/tests/yamlparser/fixtures/complete001.xml b/tests/yamlparser/fixtures/complete001.xml index 40fee172e..f6c5192d0 100644 --- a/tests/yamlparser/fixtures/complete001.xml +++ b/tests/yamlparser/fixtures/complete001.xml @@ -75,6 +75,7 @@ False + false