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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # This file is part of Buildbot. Buildbot is free software: you can 1 # This file is part of Buildbot. Buildbot is free software: you can
2 # redistribute it and/or modify it under the terms of the GNU General Public 2 # redistribute it and/or modify it under the terms of the GNU General Public
3 # License as published by the Free Software Foundation, version 2. 3 # License as published by the Free Software Foundation, version 2.
4 # 4 #
5 # This program is distributed in the hope that it will be useful, but WITHOUT 5 # This program is distributed in the hope that it will be useful, but WITHOUT
6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
8 # details. 8 # details.
9 # 9 #
10 # You should have received a copy of the GNU General Public License along with 10 # You should have received a copy of the GNU General Public License along with
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 def __init__(self, parent, step_number): 72 def __init__(self, parent, step_number):
73 assert interfaces.IBuildStatus(parent) 73 assert interfaces.IBuildStatus(parent)
74 self.build = weakref.ref(parent) 74 self.build = weakref.ref(parent)
75 self.build_number = parent.getNumber() 75 self.build_number = parent.getNumber()
76 self.builder = parent.getBuilder() 76 self.builder = parent.getBuilder()
77 self.step_number = step_number 77 self.step_number = step_number
78 self.hidden = False 78 self.hidden = False
79 self.logs = [] 79 self.logs = []
80 self.urls = collections.OrderedDict() 80 self.urls = collections.OrderedDict()
81 self.aliases = {}
81 self.watchers = [] 82 self.watchers = []
82 self.updates = {} 83 self.updates = {}
83 self.finishedWatchers = [] 84 self.finishedWatchers = []
84 self.statistics = {} 85 self.statistics = {}
85 self.skipped = False 86 self.skipped = False
86 self.nest_level = 0 87 self.nest_level = 0
87 88
88 self.waitingForLocks = False 89 self.waitingForLocks = False
89 90
90 def getName(self): 91 def getName(self):
(...skipping 23 matching lines...) Expand all
114 t = (m, self.progress.progress[m], self.progress.expectations[m]) 115 t = (m, self.progress.progress[m], self.progress.expectations[m])
115 ret.append(t) 116 ret.append(t)
116 return ret 117 return ret
117 118
118 def getLogs(self): 119 def getLogs(self):
119 return self.logs 120 return self.logs
120 121
121 def getURLs(self): 122 def getURLs(self):
122 return self.urls.copy() 123 return self.urls.copy()
123 124
125 def getAliases(self):
126 return getattr(self, 'aliases', {}).copy()
127
124 def isStarted(self): 128 def isStarted(self):
125 return (self.started is not None) 129 return (self.started is not None)
126 130
127 def isSkipped(self): 131 def isSkipped(self):
128 return self.skipped 132 return self.skipped
129 133
130 def isFinished(self): 134 def isFinished(self):
131 return (self.finished is not None) 135 return (self.finished is not None)
132 136
133 def isHidden(self): 137 def isHidden(self):
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 self.logs.append(log) 273 self.logs.append(log)
270 for w in self.watchers: 274 for w in self.watchers:
271 w.logStarted(build, self, log) 275 w.logStarted(build, self, log)
272 w.logFinished(build, self, log) 276 w.logFinished(build, self, log)
273 277
274 def logFinished(self, log): 278 def logFinished(self, log):
275 build = self.getBuild() 279 build = self.getBuild()
276 for w in self.watchers: 280 for w in self.watchers:
277 w.logFinished(build, self, log) 281 w.logFinished(build, self, log)
278 282
279 def addURL(self, name, url): 283 def addURL(self, name, url, alias_text=None):
280 self.urls[name] = url 284 self.urls[name] = url
281 285
286 def addAlias(self, name, url, text=None):
287 # "name" already exists as a URL. Add this as an alias.
288 aliases = getattr(self, 'aliases', None)
289 if aliases is None:
290 aliases = self.aliases = {}
291
292 value = aliases.setdefault(name, [])
293 if not text:
294 text = str(len(value))
295 value.append((text, url))
296
282 def setText(self, text): 297 def setText(self, text):
283 self.text = text 298 self.text = text
284 build = self.getBuild() 299 build = self.getBuild()
285 for w in self.watchers: 300 for w in self.watchers:
286 w.stepTextChanged(build, self, text) 301 w.stepTextChanged(build, self, text)
287 def setText2(self, text): 302 def setText2(self, text):
288 self.text2 = text 303 self.text2 = text
289 build = self.getBuild() 304 build = self.getBuild()
290 for w in self.watchers: 305 for w in self.watchers:
291 w.stepText2Changed(build, self, text) 306 w.stepText2Changed(build, self, text)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 result['times'] = self.getTimes() 413 result['times'] = self.getTimes()
399 result['expectations'] = self.getExpectations() 414 result['expectations'] = self.getExpectations()
400 result['eta'] = self.getETA() 415 result['eta'] = self.getETA()
401 result['urls'] = self.getURLs() 416 result['urls'] = self.getURLs()
402 result['step_number'] = self.step_number 417 result['step_number'] = self.step_number
403 result['hidden'] = self.hidden 418 result['hidden'] = self.hidden
404 result['logs'] = [[l.getName(), 419 result['logs'] = [[l.getName(),
405 self.builder.status.getURLForThing(l)] 420 self.builder.status.getURLForThing(l)]
406 for l in self.getLogs()] 421 for l in self.getLogs()]
407 return result 422 return result
OLDNEW
« 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