| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from common.base_handler import BaseHandler | 5 from gitiles.git_repository import GitRepository |
| 6 from common.base_handler import Permission | 6 from common.base_handler import BaseHandler, Permission |
| 7 from common.git_repository import GitRepository | |
| 8 from common.http_client_appengine import HttpClientAppengine as HttpClient | 7 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 9 from model.wf_analysis import WfAnalysis | 8 from model.wf_analysis import WfAnalysis |
| 10 from waterfall import buildbot | 9 from waterfall import buildbot |
| 11 from waterfall import build_util | 10 from waterfall import build_util |
| 12 | 11 |
| 13 | 12 |
| 14 def _GetFirstFailedBuild(master_name, builder_name, build_number): | 13 def _GetFirstFailedBuild(master_name, builder_name, build_number): |
| 15 """Checks failed_steps for current_build and finds the first failed build.""" | 14 """Checks failed_steps for current_build and finds the first failed build.""" |
| 16 analysis = WfAnalysis.Get(master_name, builder_name, build_number) | 15 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
| 17 if not analysis or not analysis.result['failures']: | 16 if not analysis or not analysis.result['failures']: |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 """ | 158 """ |
| 160 url = self.request.get('url').strip() | 159 url = self.request.get('url').strip() |
| 161 build_keys = buildbot.ParseBuildUrl(url) | 160 build_keys = buildbot.ParseBuildUrl(url) |
| 162 | 161 |
| 163 if not build_keys: # pragma: no cover | 162 if not build_keys: # pragma: no cover |
| 164 return {'data': {}} | 163 return {'data': {}} |
| 165 | 164 |
| 166 data = _CheckReverts(*build_keys) | 165 data = _CheckReverts(*build_keys) |
| 167 | 166 |
| 168 return {'data': data} | 167 return {'data': data} |
| OLD | NEW |