[LNT] r326771 - Render https producers as HTML hyperlinks too.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 6 01:48:06 PST 2018
Author: fhahn
Date: Tue Mar 6 01:48:06 2018
New Revision: 326771
URL: http://llvm.org/viewvc/llvm-project?rev=326771&view=rev
Log:
Render https producers as HTML hyperlinks too.
Reviewers: kristof.beyls, cmatthews
Reviewed By: cmatthews
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43295
Modified:
lnt/trunk/lnt/server/ui/util.py
lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql
lnt/trunk/tests/server/ui/V4Pages.py
Modified: lnt/trunk/lnt/server/ui/util.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=326771&r1=326770&r2=326771&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/util.py (original)
+++ lnt/trunk/lnt/server/ui/util.py Tue Mar 6 01:48:06 2018
@@ -215,20 +215,21 @@ def sorted(values, *args, **kwargs):
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 = '<img src="%(png_url)s" />' % locals()
return '<a href="%(producer)s">%(builder)s #%(build)s %(img)s</a>' % \
locals()
- elif producer.startswith('http://'):
+ elif re.search(r'^https?://.+', producer):
return '<a href="' + producer + '">Producer</a>'
else:
Modified: lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql?rev=326771&r1=326770&r2=326771&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql (original)
+++ lnt/trunk/tests/server/ui/Inputs/V4Pages_extra_records.sql Tue Mar 6 01:48:06 2018
@@ -82,11 +82,13 @@ INSERT INTO "NT_Run" ("MachineID", "Orde
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")
Modified: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=326771&r1=326770&r2=326771&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (original)
+++ lnt/trunk/tests/server/ui/V4Pages.py Tue Mar 6 01:48:06 2018
@@ -356,11 +356,17 @@ def main():
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')
More information about the llvm-commits
mailing list