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 import collections | 5 import collections |
6 import os | 6 import os |
7 import re | 7 import re |
8 | 8 |
9 from common.diff import ChangeType | 9 from common.diff import ChangeType |
10 from waterfall.failure_signal import FailureSignal | 10 from waterfall.failure_signal import FailureSignal |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 for touched_file in change_log['touched_files']: | 269 for touched_file in change_log['touched_files']: |
270 _CheckFile( | 270 _CheckFile( |
271 touched_file, file_path_in_log, justification, file_name_occurrences) | 271 touched_file, file_path_in_log, justification, file_name_occurrences) |
272 | 272 |
273 if not justification.score: | 273 if not justification.score: |
274 return None | 274 return None |
275 else: | 275 else: |
276 return justification.ToDict() | 276 return justification.ToDict() |
277 | 277 |
278 | 278 |
279 def AnalyzeBuildFailure(failure_info, change_logs, failure_signals): | 279 # TODO: use DEPS info to detect dependency rolls -- pylint: disable=W0613 |
280 def AnalyzeBuildFailure( | |
281 failure_info, change_logs, deps_info, failure_signals): | |
280 """Analyze the given failure signals, and figure out culprit CLs. | 282 """Analyze the given failure signals, and figure out culprit CLs. |
281 | 283 |
282 Args: | 284 Args: |
283 failure_info (dict): Output of pipeline DetectFirstFailurePipeline. | 285 failure_info (dict): Output of pipeline DetectFirstFailurePipeline. |
284 change_logs (dict): Output of pipeline PullChangelogPipeline. | 286 change_logs (dict): Output of pipeline PullChangelogPipeline. |
287 deps_info (dict): Output of pipeline ExtractDEPSInfoPipeline. | |
chanli
2015/05/29 01:00:07
Why I can't find where do you use this argument in
stgao
2015/05/29 16:46:54
I added a TODO above for that.
However, I made a
| |
285 failure_signals (dict): Output of pipeline ExtractSignalPipeline. | 288 failure_signals (dict): Output of pipeline ExtractSignalPipeline. |
286 | 289 |
287 Returns: | 290 Returns: |
288 A dict with the following form: | 291 A dict with the following form: |
289 { | 292 { |
290 'failures': [ | 293 'failures': [ |
291 { | 294 { |
292 'step_name': 'compile', | 295 'step_name': 'compile', |
293 'first_failure': 230, | 296 'first_failure': 230, |
294 'last_pass': 229, | 297 'last_pass': 229, |
(...skipping 19 matching lines...) Expand all Loading... | |
314 } | 317 } |
315 """ | 318 """ |
316 analysis_result = { | 319 analysis_result = { |
317 'failures': [] | 320 'failures': [] |
318 } | 321 } |
319 | 322 |
320 if not failure_info['failed']: | 323 if not failure_info['failed']: |
321 return analysis_result | 324 return analysis_result |
322 | 325 |
323 def CreateCLInfoDict(justification_dict, build_number, change_log): | 326 def CreateCLInfoDict(justification_dict, build_number, change_log): |
324 # TODO(stgao): remove hard-coded 'chromium' when DEPS file parsing is | 327 # TODO(stgao): remove hard-coded 'chromium' when DEPS file parsing is |
chanli
2015/05/29 01:00:07
does this todo relate to thi CL?
stgao
2015/05/29 16:46:54
More work is needed for this. I'd leave this as is
| |
325 # supported. | 328 # supported. |
326 cl_info = { | 329 cl_info = { |
327 'build_number': build_number, | 330 'build_number': build_number, |
328 'repo_name': 'chromium', | 331 'repo_name': 'chromium', |
329 'revision': change_log['revision'], | 332 'revision': change_log['revision'], |
330 'commit_position': change_log.get('commit_position'), | 333 'commit_position': change_log.get('commit_position'), |
331 'url': | 334 'url': |
332 change_log.get('code_review_url') or change_log.get('commit_url'), | 335 change_log.get('code_review_url') or change_log.get('commit_url'), |
333 } | 336 } |
334 | 337 |
(...skipping 28 matching lines...) Expand all Loading... | |
363 step_analysis_result['suspected_cls'].append( | 366 step_analysis_result['suspected_cls'].append( |
364 CreateCLInfoDict(justification_dict, build_number, | 367 CreateCLInfoDict(justification_dict, build_number, |
365 change_logs[revision])) | 368 change_logs[revision])) |
366 | 369 |
367 build_number += 1 | 370 build_number += 1 |
368 | 371 |
369 # TODO(stgao): sort CLs by score. | 372 # TODO(stgao): sort CLs by score. |
370 analysis_result['failures'].append(step_analysis_result) | 373 analysis_result['failures'].append(step_analysis_result) |
371 | 374 |
372 return analysis_result | 375 return analysis_result |
OLD | NEW |