Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1403)

Unified Diff: third_party/buildbot_8_4p1/buildbot/status/web/build.py

Issue 1885033002: BuildBot: Add anchors for unbound aliases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/buildbot_8_4p1/buildbot/status/web/build.py
diff --git a/third_party/buildbot_8_4p1/buildbot/status/web/build.py b/third_party/buildbot_8_4p1/buildbot/status/web/build.py
index dd1842baa543cabaae958381718787bd50b9aa3d..5ee9ae66e03e05f10e759b798c6cf0bf31ac70ac 100644
--- a/third_party/buildbot_8_4p1/buildbot/status/web/build.py
+++ b/third_party/buildbot_8_4p1/buildbot/status/web/build.py
@@ -121,13 +121,6 @@ class StatusResourceBuild(HtmlResource):
step['urls'] = map(lambda x:dict(url=x[1],logname=x[0]), s.getURLs().items())
step['nest_level'] = s.getNestLevel()
- step['aliases'] = {}
- for base, aliases in s.getAliases().iteritems():
- step['aliases'][base] = [{
- 'text': a[0],
- 'url': a[1],
- } for a in aliases]
-
step['logs']= []
for l in s.getLogs():
@@ -137,6 +130,29 @@ class StatusResourceBuild(HtmlResource):
urllib.quote(logname, safe=''))),
'name': logname })
+ step['aliases'] = {}
+ seen_aliases = set()
+ for base, aliases in s.getAliases().iteritems():
+ step['aliases'][base] = [{
+ 'text': a[0],
+ 'url': a[1],
+ } for a in aliases]
+ seen_aliases.add(base)
+
+ seen_aliases.difference_update(s['logname'] for s in step['urls'])
+ seen_aliases.difference_update(s['name'] for s in step['logs'])
+
+ # Append link-less log anchors for unbased aliases to attach to.
+ #
+ # We include an empty link so that custom templates that don't
+ # support aliases don't crash when trying to render these anchors.
+ # This will cause waterfalls that have alias data but haven't
+ # updated their templates to render them to show blank links. This
+ # is okay, since waterfalls that accept alias data should have
+ # their templates updated to render this data.
+ for base in sorted(seen_aliases):
+ step['logs'].append({'name': base, 'link': ''})
+
dnj 2016/04/13 15:39:59 Note: because templates are immediately loaded pos
ps = cxt['properties'] = []
for name, value, source in b.getProperties().asList():
value = str(value)

Powered by Google App Engine
This is Rietveld 408576698