Remove hostname hardcode from commit records links

Determine Gerrit hostname from configuration during data processing and
set for each 'commit' record.

Change-Id: I7129d4a6296f28d1e1e63eabfd528ccc9c1d155a
This commit is contained in:
Andrii Ostapenko
2019-03-05 23:50:47 -06:00
parent 2d2890859e
commit 2b94ab032d
4 changed files with 68 additions and 13 deletions

View File

@@ -46,7 +46,42 @@ returned.
Fixes bug <a href="https://bugs.launchpad.net/bugs/1076801" class="ext_link">\
1076801</a>
''' + (
'Change-Id: <a href="https://review.openstack.org/#/q/'
'Change-Id: <a href="http://review.openstack.org/#/q/'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db" class="ext_link">'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>')
observed = helpers.make_commit_message(record)
self.assertEqual(expected, observed,
'Commit message should be processed correctly')
def test_make_commit_message_gerrit_host(self):
message = '''
During finish_migration the manager calls initialize_connection but doesn't
update the block_device_mapping with the potentially new connection_info
returned.
Fixes bug 1076801
Change-Id: Ie49ccd2138905e178843b375a9b16c3fe572d1db'''
module = 'test'
gerrit = 'someothergerrit.org'
record = {
'message': message,
'module': module,
'gerrit_hostname': gerrit,
}
expected = '''\
During finish_migration the manager calls initialize_connection but doesn't \
update the block_device_mapping with the potentially new connection_info \
returned.
Fixes bug <a href="https://bugs.launchpad.net/bugs/1076801" class="ext_link">\
1076801</a>
''' + (
'Change-Id: <a href="http://%s/#/q/' % gerrit +
'Ie49ccd2138905e178843b375a9b16c3fe572d1db" class="ext_link">'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>')
@@ -73,7 +108,7 @@ Implemented new driver for Cinder &lt;:
Implements Blueprint ''' + (
'<a href="https://blueprints.launchpad.net/cinder/+spec/'
'super-driver" class="ext_link">super-driver</a>' + '\n' +
'Change-Id: <a href="https://review.openstack.org/#/q/'
'Change-Id: <a href="http://review.openstack.org/#/q/'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db" class="ext_link">'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>')