| 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 collections import defaultdict | 5 from collections import defaultdict |
| 6 import logging | 6 import logging |
| 7 | 7 |
| 8 from google.appengine.ext import ndb | 8 from google.appengine.ext import ndb |
| 9 | 9 |
| 10 from common.git_repository import GitRepository | 10 from common.git_repository import GitRepository |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 # Arguments number differs from overridden method - pylint: disable=W0221 | 272 # Arguments number differs from overridden method - pylint: disable=W0221 |
| 273 def run( | 273 def run( |
| 274 self, master_name, builder_name, build_number, blame_list, try_job_type, | 274 self, master_name, builder_name, build_number, blame_list, try_job_type, |
| 275 try_job_id, result): | 275 try_job_id, result): |
| 276 """Identifies the information for failed revisions. | 276 """Identifies the information for failed revisions. |
| 277 | 277 |
| 278 Please refer to try_job_result_format.md for format check. | 278 Please refer to try_job_result_format.md for format check. |
| 279 """ | 279 """ |
| 280 culprits = None | 280 culprits = None |
| 281 if result and result.get('report'): | 281 if try_job_id and result and result.get('report'): |
| 282 try_job_data = WfTryJobData.Get(try_job_id) | 282 try_job_data = WfTryJobData.Get(try_job_id) |
| 283 if try_job_type == failure_type.COMPILE: | 283 if try_job_type == failure_type.COMPILE: |
| 284 # For compile failures, the try job will stop if one revision fails, so | 284 # For compile failures, the try job will stop if one revision fails, so |
| 285 # the culprit will be the last revision in the result. | 285 # the culprit will be the last revision in the result. |
| 286 failed_revision = _GetFailedRevisionFromCompileResult(result) | 286 failed_revision = _GetFailedRevisionFromCompileResult(result) |
| 287 failed_revisions = [failed_revision] if failed_revision else [] | 287 failed_revisions = [failed_revision] if failed_revision else [] |
| 288 culprits = self._GetCulpritInfo(failed_revisions) | 288 culprits = self._GetCulpritInfo(failed_revisions) |
| 289 if culprits: | 289 if culprits: |
| 290 result['culprit'] = { | 290 result['culprit'] = { |
| 291 'compile': culprits[failed_revision] | 291 'compile': culprits[failed_revision] |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 analysis.result_status = updated_result_status | 333 analysis.result_status = updated_result_status |
| 334 analysis.suspected_cls = updated_suspected_cls | 334 analysis.suspected_cls = updated_suspected_cls |
| 335 analysis.put() | 335 analysis.put() |
| 336 | 336 |
| 337 # Store try-job results. | 337 # Store try-job results. |
| 338 UpdateTryJobResult() | 338 UpdateTryJobResult() |
| 339 # Add try-job results to WfAnalysis. | 339 # Add try-job results to WfAnalysis. |
| 340 UpdateWfAnalysisWithTryJobResult() | 340 UpdateWfAnalysisWithTryJobResult() |
| 341 | 341 |
| 342 _NotifyCulprits(master_name, builder_name, build_number, culprits) | 342 _NotifyCulprits(master_name, builder_name, build_number, culprits) |
| 343 return result.get('culprit') if result else None | 343 return result.get('culprit') if result else None |
| OLD | NEW |