Add github reporter status-url config option
Make it possible to set the github status link to something other than the
zuul server status_url. This allows the github status to link to the log output
for the jobs. If set, this url will be run through the same formatter
as the url_pattern used for comment links. If unset, it will fall back to the
previous behaviour of using the zuul server status_url.
Handle status-url from the reporter config and the zuul config the same
way and remove the hard coded change url format from zuul.conf. If a
user wants to specify the change id in the status url they should use
a template string in the same way as configuring a reporter.
Co-Authored-By: Jamie Lennox <jamielennox@gmail.com>
Change-Id: I5f2ff35bb38426ddcd7f65798b4f114256a54847
diff --git a/tests/unit/test_github_driver.py b/tests/unit/test_github_driver.py
index 227d659..6cc010e 100644
--- a/tests/unit/test_github_driver.py
+++ b/tests/unit/test_github_driver.py
@@ -300,6 +300,9 @@
self.assertEqual('tenant-one/reporting', report_status['context'])
self.assertEqual('success', report_status['state'])
self.assertEqual(2, len(A.comments))
+ report_url = ('http://logs.example.com/reporting/%s/%s/%s/' %
+ (A.project, A.number, A.head_sha))
+ self.assertEqual(report_url, report_status['url'])
@simple_layout('layouts/merging-github.yaml', driver='github')
def test_report_pull_merge(self):