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

Unified Diff: third_party/buildbot_8_4p1/buildbot/status/buildstep.py

Issue 1812163002: Add log and link aliasing to BuildBot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Unused variable. Created 4 years, 9 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
« no previous file with comments | « scripts/master/unittests/annotator_test.py ('k') | third_party/buildbot_8_4p1/buildbot/status/web/build.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/buildbot_8_4p1/buildbot/status/buildstep.py
diff --git a/third_party/buildbot_8_4p1/buildbot/status/buildstep.py b/third_party/buildbot_8_4p1/buildbot/status/buildstep.py
index cbd8cc4fad5e235612c291906af89e4562b5140a..a898e669bb890ed2438533b70310323f95262981 100644
--- a/third_party/buildbot_8_4p1/buildbot/status/buildstep.py
+++ b/third_party/buildbot_8_4p1/buildbot/status/buildstep.py
@@ -78,6 +78,7 @@ class BuildStepStatus(styles.Versioned):
self.hidden = False
self.logs = []
self.urls = collections.OrderedDict()
+ self.aliases = {}
self.watchers = []
self.updates = {}
self.finishedWatchers = []
@@ -121,6 +122,9 @@ class BuildStepStatus(styles.Versioned):
def getURLs(self):
return self.urls.copy()
+ def getAliases(self):
+ return getattr(self, 'aliases', {}).copy()
+
def isStarted(self):
return (self.started is not None)
@@ -276,9 +280,20 @@ class BuildStepStatus(styles.Versioned):
for w in self.watchers:
w.logFinished(build, self, log)
- def addURL(self, name, url):
+ def addURL(self, name, url, alias_text=None):
self.urls[name] = url
+ def addAlias(self, name, url, text=None):
+ # "name" already exists as a URL. Add this as an alias.
+ aliases = getattr(self, 'aliases', None)
+ if aliases is None:
+ aliases = self.aliases = {}
+
+ value = aliases.setdefault(name, [])
+ if not text:
+ text = str(len(value))
+ value.append((text, url))
+
def setText(self, text):
self.text = text
build = self.getBuild()
« no previous file with comments | « scripts/master/unittests/annotator_test.py ('k') | third_party/buildbot_8_4p1/buildbot/status/web/build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698