Merge "Allow to omit list of projects in Gerrit trigger config"

This commit is contained in:
Jenkins 2016-03-18 14:33:55 +00:00 committed by Gerrit Code Review
commit 1778d1037a
3 changed files with 50 additions and 2 deletions

View File

@ -80,7 +80,7 @@ def gerrit_handle_legacy_configuration(data):
'skipVote',
])
for project in data['projects']:
for project in data.get('projects', []):
convert_dict(project, [
'projectCompareType',
'projectPattern',
@ -443,7 +443,7 @@ def gerrit(parser, xml_parent, data):
gerrit_handle_legacy_configuration(data)
projects = data['projects']
projects = data.get('projects', [])
gtrig = XML.SubElement(xml_parent,
'com.sonyericsson.hudson.plugins.gerrit.trigger.'
'hudsontrigger.GerritTrigger')

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<triggers class="vector">
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
<spec/>
<gerritProjects/>
<skipVote>
<onSuccessful>false</onSuccessful>
<onFailed>false</onFailed>
<onUnstable>false</onUnstable>
<onNotBuilt>false</onNotBuilt>
</skipVote>
<silentMode>false</silentMode>
<silentStartMode>false</silentStartMode>
<escapeQuotes>true</escapeQuotes>
<noNameAndEmailParameters>false</noNameAndEmailParameters>
<readableMessage>false</readableMessage>
<dependencyJobsNames/>
<notificationLevel/>
<dynamicTriggerConfiguration>True</dynamicTriggerConfiguration>
<triggerConfigURL>http://myhost/mytrigger</triggerConfigURL>
<allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
<triggerOnEvents>
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedEvent>
<verdictCategory>APRV</verdictCategory>
<commentAddedTriggerApprovalValue>-1</commentAddedTriggerApprovalValue>
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedEvent>
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeAbandonedEvent/>
</triggerOnEvents>
<buildStartMessage/>
<buildFailureMessage/>
<buildSuccessfulMessage/>
<buildUnstableMessage/>
<buildNotBuiltMessage/>
<buildUnsuccessfulFilepath/>
<customUrl/>
<serverName>__ANY__</serverName>
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
</triggers>
</project>

View File

@ -0,0 +1,8 @@
triggers:
- gerrit:
trigger-on-comment-added-event: true
trigger-approval-category: 'APRV'
trigger-approval-value: -1
trigger-on-change-abandoned-event: true
dynamic-trigger-enabled: true
dynamic-trigger-url: http://myhost/mytrigger