Index: lnt/trunk/lnt/server/ui/util.py
===================================================================
--- lnt/trunk/lnt/server/ui/util.py
+++ lnt/trunk/lnt/server/ui/util.py
@@ -215,20 +215,21 @@
def renderProducerAsHTML(producer):
# If the string looks like a buildbot link, render it prettily.
- m = re.match(r'http://(.*)/builders/(.*)/builds/(\d+)', producer)
+ m = re.match(r'(https?)://(.*)/builders/(.*)/builds/(\d+)', producer)
if m:
- url = m.group(1)
- builder = m.group(2)
- build = m.group(3)
+ protocol = m.group(1)
+ url = m.group(2)
+ builder = m.group(3)
+ build = m.group(4)
png_url = \
- 'http://%(url)s/png?builder=%(builder)s&number=%(build)s' % \
- locals()
+ '%(protocol)s://%(url)s/png?builder=%(builder)s&' \
+ 'number=%(build)s' % locals()
img = '' % locals()
return '%(builder)s #%(build)s %(img)s' % \
locals()
- elif producer.startswith('http://'):
+ elif re.search(r'^https?://.+', producer):
return 'Producer'
else:
Index: lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql
===================================================================
--- lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql
+++ lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql
@@ -82,11 +82,13 @@
INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime",
"EndTime", "SimpleRunID", "Parameters")
VALUES(2,7,'run8.json','2012-05-11 16:28:23.000000',
- '2012-05-11 16:28:58.000000',NULL,'[]'); -- ID 8
+ '2012-05-11 16:28:58.000000',NULL,
+ '[["producer", "https://my.build.server/buildResult"]]'); -- ID 8
INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime",
"EndTime", "SimpleRunID", "Parameters")
VALUES(2,8,'run9.json','2012-05-12 16:28:23.000000',
- '2012-05-12 16:28:58.000000',NULL,'[]'); -- ID 9
+ '2012-05-12 16:28:58.000000',NULL,
+ '[["producer", "https://buildbot.server.url/builders/some-builder/builds/999"]]'); -- ID 9
INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status",
"execution_status", "compile_time", "execution_time",
"score", "mem_bytes")
Index: lnt/trunk/tests/server/ui/V4Pages.py
===================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py
+++ lnt/trunk/tests/server/ui/V4Pages.py
@@ -356,11 +356,17 @@
check_producer_label(client, '/v4/nts/7',
['Current', '152293', '2012-05-10T16:28:23',
'0:00:35', 'Producer'])
+ check_producer_label(client, '/v4/nts/8',
+ ['Current', '152294', '2012-05-11T16:28:23',
+ '0:00:35', 'Producer'])
# Get a run that contains Buildbot producer information
check_producer_label(client, '/v4/nts/7',
['Previous', '152292', '2012-05-01T16:28:23',
'0:00:35', 'some-builder #987'])
+ check_producer_label(client, '/v4/nts/9',
+ ['Current', '152295', '2012-05-12T16:28:23',
+ '0:00:35', 'some-builder #999'])
# Get the new graph page.
check_html(client, '/v4/nts/graph?plot.0=1.3.2')