Add branch to all the remaining event messages
Branch is always useful to know. ;-) Change-Id: Icece8d06c771dbd55825655206f75810d9fa43e6
This commit is contained in:
parent
3cefaa8617
commit
75e2c2f03d
|
@ -211,8 +211,9 @@ class Gerrit(threading.Thread):
|
||||||
|
|
||||||
def comment_added(self, channel, data):
|
def comment_added(self, channel, data):
|
||||||
if channel in self._channels_for('events', 'x-all-comments'):
|
if channel in self._channels_for('events', 'x-all-comments'):
|
||||||
msg = 'A comment has been added to %s: %s %s' % (
|
msg = 'A comment has been added to %s %s: %s %s' % (
|
||||||
data['change']['project'],
|
data['change']['project'],
|
||||||
|
data['change']['branch'],
|
||||||
data['change']['subject'],
|
data['change']['subject'],
|
||||||
data['change']['url'])
|
data['change']['url'])
|
||||||
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
||||||
|
@ -222,8 +223,9 @@ class Gerrit(threading.Thread):
|
||||||
if (approval['type'] == 'Verified' and approval['value'] == '-2'
|
if (approval['type'] == 'Verified' and approval['value'] == '-2'
|
||||||
and channel in self._channels_for('events',
|
and channel in self._channels_for('events',
|
||||||
'x-vrif-minus-2')):
|
'x-vrif-minus-2')):
|
||||||
msg = 'Verification of a change to %s failed: %s %s' % (
|
msg = 'Verification of a change to %s %s failed: %s %s' % (
|
||||||
data['change']['project'],
|
data['change']['project'],
|
||||||
|
data['change']['branch'],
|
||||||
data['change']['subject'],
|
data['change']['subject'],
|
||||||
data['change']['url'])
|
data['change']['url'])
|
||||||
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
||||||
|
@ -232,8 +234,9 @@ class Gerrit(threading.Thread):
|
||||||
if (approval['type'] == 'Verified' and approval['value'] == '2'
|
if (approval['type'] == 'Verified' and approval['value'] == '2'
|
||||||
and channel in self._channels_for('events',
|
and channel in self._channels_for('events',
|
||||||
'x-vrif-plus-2')):
|
'x-vrif-plus-2')):
|
||||||
msg = 'Verification of a change to %s succeeded: %s %s' % (
|
msg = 'Verification of a change to %s %s succeeded: %s %s' % (
|
||||||
data['change']['project'],
|
data['change']['project'],
|
||||||
|
data['change']['branch'],
|
||||||
data['change']['subject'],
|
data['change']['subject'],
|
||||||
data['change']['url'])
|
data['change']['url'])
|
||||||
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
||||||
|
@ -242,8 +245,9 @@ class Gerrit(threading.Thread):
|
||||||
if (approval['type'] == 'Code-Review' and approval['value'] == '-2'
|
if (approval['type'] == 'Code-Review' and approval['value'] == '-2'
|
||||||
and channel in self._channels_for('events',
|
and channel in self._channels_for('events',
|
||||||
'x-crvw-minus-2')):
|
'x-crvw-minus-2')):
|
||||||
msg = 'A change to %s has been rejected: %s %s' % (
|
msg = 'A change to %s %s has been rejected: %s %s' % (
|
||||||
data['change']['project'],
|
data['change']['project'],
|
||||||
|
data['change']['branch'],
|
||||||
data['change']['subject'],
|
data['change']['subject'],
|
||||||
data['change']['url'])
|
data['change']['url'])
|
||||||
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
||||||
|
@ -252,8 +256,9 @@ class Gerrit(threading.Thread):
|
||||||
if (approval['type'] == 'Code-Review' and approval['value'] == '2'
|
if (approval['type'] == 'Code-Review' and approval['value'] == '2'
|
||||||
and channel in self._channels_for('events',
|
and channel in self._channels_for('events',
|
||||||
'x-crvw-plus-2')):
|
'x-crvw-plus-2')):
|
||||||
msg = 'A change to %s has been approved: %s %s' % (
|
msg = 'A change to %s %s has been approved: %s %s' % (
|
||||||
data['change']['project'],
|
data['change']['project'],
|
||||||
|
data['change']['branch'],
|
||||||
data['change']['subject'],
|
data['change']['subject'],
|
||||||
data['change']['url'])
|
data['change']['url'])
|
||||||
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
self.log.info('Compiled Message %s: %s' % (channel, msg))
|
||||||
|
|
|
@ -195,7 +195,7 @@ class GerritTestCase(testtools.TestCase):
|
||||||
self.assertEqual(self.channel, message.channel)
|
self.assertEqual(self.channel, message.channel)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
'A comment has been added to '
|
'A comment has been added to '
|
||||||
'openstack/gerritbot: More unit tests '
|
'openstack/gerritbot master: More unit tests '
|
||||||
'https://review.openstack.org/123456',
|
'https://review.openstack.org/123456',
|
||||||
message.msg)
|
message.msg)
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ class GerritTestCase(testtools.TestCase):
|
||||||
message = self.ircbot.messages[1]
|
message = self.ircbot.messages[1]
|
||||||
self.assertEqual(self.channel, message.channel)
|
self.assertEqual(self.channel, message.channel)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
'Verification of a change to openstack/gerritbot failed: '
|
'Verification of a change to openstack/gerritbot master failed: '
|
||||||
'More unit tests https://review.openstack.org/123456',
|
'More unit tests https://review.openstack.org/123456',
|
||||||
message.msg)
|
message.msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue