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

Side by Side Diff: master/webstatus/builder_statuses.py

Issue 648353002: Remove Skia's forked buildbot code (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Address comment Created 6 years, 2 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
« no previous file with comments | « master/webstatus/__init__.py ('k') | master/webstatus/buildstatus.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5
6 """JSON interface which returns the most recent results for each builder."""
7
8
9 import buildbot.status.web.base as base
10 import builder_name_schema
11
12 from buildbot.status.web.status_json import JsonResource
13 from twisted.python import log
14
15
16 class BuilderStatusesJsonResource(JsonResource):
17 """Returns the results of the last completed build for each builder.
18
19 This is essentially a JSON equivalent of the upstream
20 horizontal_one_box_per_builder HTML page, as in
21 third_party/chromium_buildbot/scripts/master/chromium_status_bb8.py.
22 """
23
24 def asDict(self, request):
25 builders = request.args.get('builder', self.status.getBuilderNames())
26 data = {'builders': []}
27 for builder_name in builders:
28 if builder_name_schema.IsTrybot(builder_name):
29 continue
30 try:
31 builder_status = self.status.getBuilder(builder_name)
32 except KeyError:
33 log.msg('status.getBuilder(%r) failed' % builder_name)
34 continue
35 outcome = base.ITopBox(builder_status).getBox(request).class_
36 lastbuild = 'LastBuild'
37 if outcome.startswith(lastbuild):
38 outcome = outcome[len(lastbuild):]
39 data['builders'].append({'outcome': outcome.strip(),
40 'name': builder_name})
41 return data
OLDNEW
« no previous file with comments | « master/webstatus/__init__.py ('k') | master/webstatus/buildstatus.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698