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 common.base_handler import BaseHandler |
6 from common.base_handler import Permission | 6 from common.base_handler import 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 |
| 8 from lib.gitiles.gitiles_repository import GitilesRepository |
9 from model.wf_analysis import WfAnalysis | 9 from model.wf_analysis import WfAnalysis |
10 from waterfall import buildbot | 10 from waterfall import buildbot |
11 from waterfall import build_util | 11 from waterfall import build_util |
12 | 12 |
13 | 13 |
14 def _GetFirstFailedBuild(master_name, builder_name, build_number): | 14 def _GetFirstFailedBuild(master_name, builder_name, build_number): |
15 """Checks failed_steps for current_build and finds the first failed build.""" | 15 """Checks failed_steps for current_build and finds the first failed build.""" |
16 analysis = WfAnalysis.Get(master_name, builder_name, build_number) | 16 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
17 if not analysis or not analysis.result['failures']: | 17 if not analysis or not analysis.result['failures']: |
18 return None, None | 18 return None, None |
(...skipping 12 matching lines...) Expand all Loading... |
31 | 31 |
32 | 32 |
33 def _AllFailedStepsPassed(passed_steps, current_failed_steps): | 33 def _AllFailedStepsPassed(passed_steps, current_failed_steps): |
34 for current_failed_step in current_failed_steps: | 34 for current_failed_step in current_failed_steps: |
35 if current_failed_step not in passed_steps: | 35 if current_failed_step not in passed_steps: |
36 return False | 36 return False |
37 return True | 37 return True |
38 | 38 |
39 def GetPossibleRevertInfoFromRevision(revision): | 39 def GetPossibleRevertInfoFromRevision(revision): |
40 """Parse message to get information of reverting and reverted cls.""" | 40 """Parse message to get information of reverting and reverted cls.""" |
41 git_repo = GitRepository('https://chromium.googlesource.com/chromium/src.git', | 41 git_repo = GitilesRepository( |
42 HttpClient()) | 42 'https://chromium.googlesource.com/chromium/src.git', HttpClient()) |
43 change_log = git_repo.GetChangeLog(revision) | 43 change_log = git_repo.GetChangeLog(revision) |
44 if not change_log: # pragma: no cover | 44 if not change_log: # pragma: no cover |
45 return {} | 45 return {} |
46 | 46 |
47 reverted_revision = change_log.reverted_revision | 47 reverted_revision = change_log.reverted_revision |
48 if not reverted_revision: | 48 if not reverted_revision: |
49 return {} | 49 return {} |
50 | 50 |
51 reverted_cl_change_log = git_repo.GetChangeLog(reverted_revision) | 51 reverted_cl_change_log = git_repo.GetChangeLog(reverted_revision) |
52 | 52 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 """ | 159 """ |
160 url = self.request.get('url').strip() | 160 url = self.request.get('url').strip() |
161 build_keys = buildbot.ParseBuildUrl(url) | 161 build_keys = buildbot.ParseBuildUrl(url) |
162 | 162 |
163 if not build_keys: # pragma: no cover | 163 if not build_keys: # pragma: no cover |
164 return {'data': {}} | 164 return {'data': {}} |
165 | 165 |
166 data = _CheckReverts(*build_keys) | 166 data = _CheckReverts(*build_keys) |
167 | 167 |
168 return {'data': data} | 168 return {'data': data} |
OLD | NEW |