Fix typo in ircbot's default matrix-notifier.
* Add a test fixture for the ircbot plugin that shows the bug. * Fix the bug. Update: Extract original example from the documentation as ircbot001.yaml and include in the doc via literalinclude. Add a second test case, ircbot002.yaml to demonstrate the bug fixed by this patch. Closes-Bug: #1290376 Change-Id: Ifcb96a6dab5ee923cee7d3e71bfe518f1e3d0ebc
This commit is contained in:
parent
bed596e8c6
commit
70ea148123
|
@ -2736,25 +2736,9 @@ def ircbot(parser, xml_parent, data):
|
||||||
* **only-configurations** (default)
|
* **only-configurations** (default)
|
||||||
* **only-parent**
|
* **only-parent**
|
||||||
|
|
||||||
Example::
|
Example:
|
||||||
|
|
||||||
publishers:
|
|
||||||
- ircbot:
|
|
||||||
strategy: all
|
|
||||||
notify-start: false
|
|
||||||
notify-committers: false
|
|
||||||
notify-culprits: false
|
|
||||||
notify-upstream: false
|
|
||||||
notify-fixers: false
|
|
||||||
message-type: summary-scm
|
|
||||||
channels:
|
|
||||||
- name: '#jenkins-channel1'
|
|
||||||
password: secrete
|
|
||||||
notify-only: false
|
|
||||||
- name: '#jenkins-channel2'
|
|
||||||
notify-only: true
|
|
||||||
matrix-notifier: only-configurations
|
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/publishers/fixtures/ircbot001.yaml
|
||||||
"""
|
"""
|
||||||
top = XML.SubElement(xml_parent, 'hudson.plugins.ircbot.IrcPublisher')
|
top = XML.SubElement(xml_parent, 'hudson.plugins.ircbot.IrcPublisher')
|
||||||
message_dict = {'summary-scm': 'DefaultBuildToChatNotifier',
|
message_dict = {'summary-scm': 'DefaultBuildToChatNotifier',
|
||||||
|
@ -2801,7 +2785,7 @@ def ircbot(parser, xml_parent, data):
|
||||||
matrix_dict = {'all': 'ALL',
|
matrix_dict = {'all': 'ALL',
|
||||||
'only-configurations': 'ONLY_CONFIGURATIONS',
|
'only-configurations': 'ONLY_CONFIGURATIONS',
|
||||||
'only-parent': 'ONLY_PARENT'}
|
'only-parent': 'ONLY_PARENT'}
|
||||||
matrix = data.get('matrix-notifier', 'only_configurations')
|
matrix = data.get('matrix-notifier', 'only-configurations')
|
||||||
if matrix not in matrix_dict:
|
if matrix not in matrix_dict:
|
||||||
raise JenkinsJobsException("matrix-notifier entered is not valid, "
|
raise JenkinsJobsException("matrix-notifier entered is not valid, "
|
||||||
"must be one of: %s" %
|
"must be one of: %s" %
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<hudson.plugins.ircbot.IrcPublisher>
|
||||||
|
<buildToChatNotifier class="hudson.plugins.im.build_notify.DefaultBuildToChatNotifier"/>
|
||||||
|
<strategy>ALL</strategy>
|
||||||
|
<targets>
|
||||||
|
<hudson.plugins.im.GroupChatIMMessageTarget>
|
||||||
|
<name>#jenkins-channel1</name>
|
||||||
|
<password>secrete</password>
|
||||||
|
<notificationOnly>false</notificationOnly>
|
||||||
|
</hudson.plugins.im.GroupChatIMMessageTarget>
|
||||||
|
<hudson.plugins.im.GroupChatIMMessageTarget>
|
||||||
|
<name>#jenkins-channel2</name>
|
||||||
|
<password/>
|
||||||
|
<notificationOnly>true</notificationOnly>
|
||||||
|
</hudson.plugins.im.GroupChatIMMessageTarget>
|
||||||
|
</targets>
|
||||||
|
<notifyOnBuildStart>false</notifyOnBuildStart>
|
||||||
|
<notifySuspects>false</notifySuspects>
|
||||||
|
<notifyCulprits>false</notifyCulprits>
|
||||||
|
<notifyFixers>false</notifyFixers>
|
||||||
|
<notifyUpstreamCommitters>false</notifyUpstreamCommitters>
|
||||||
|
<matrixMultiplier>ONLY_CONFIGURATIONS</matrixMultiplier>
|
||||||
|
</hudson.plugins.ircbot.IrcPublisher>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
|
@ -0,0 +1,16 @@
|
||||||
|
publishers:
|
||||||
|
- ircbot:
|
||||||
|
strategy: all
|
||||||
|
notify-start: false
|
||||||
|
notify-committers: false
|
||||||
|
notify-culprits: false
|
||||||
|
notify-upstream: false
|
||||||
|
notify-fixers: false
|
||||||
|
message-type: summary-scm
|
||||||
|
channels:
|
||||||
|
- name: '#jenkins-channel1'
|
||||||
|
password: secrete
|
||||||
|
notify-only: false
|
||||||
|
- name: '#jenkins-channel2'
|
||||||
|
notify-only: true
|
||||||
|
matrix-notifier: only-configurations
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<hudson.plugins.ircbot.IrcPublisher>
|
||||||
|
<buildToChatNotifier class="hudson.plugins.im.build_notify.DefaultBuildToChatNotifier"/>
|
||||||
|
<strategy>ALL</strategy>
|
||||||
|
<targets>
|
||||||
|
<hudson.plugins.im.GroupChatIMMessageTarget>
|
||||||
|
<name>#jenkins-channel</name>
|
||||||
|
<password/>
|
||||||
|
<notificationOnly>true</notificationOnly>
|
||||||
|
</hudson.plugins.im.GroupChatIMMessageTarget>
|
||||||
|
</targets>
|
||||||
|
<notifyOnBuildStart>false</notifyOnBuildStart>
|
||||||
|
<notifySuspects>false</notifySuspects>
|
||||||
|
<notifyCulprits>false</notifyCulprits>
|
||||||
|
<notifyFixers>false</notifyFixers>
|
||||||
|
<notifyUpstreamCommitters>false</notifyUpstreamCommitters>
|
||||||
|
<matrixMultiplier>ONLY_CONFIGURATIONS</matrixMultiplier>
|
||||||
|
</hudson.plugins.ircbot.IrcPublisher>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
|
@ -0,0 +1,5 @@
|
||||||
|
publishers:
|
||||||
|
- ircbot:
|
||||||
|
channels:
|
||||||
|
- name: '#jenkins-channel'
|
||||||
|
notify-only: true
|
Loading…
Reference in New Issue