| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 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 """Process crashes from Chrome crash server and find culprits for them.""" |
| 6 |
| 7 |
| 8 def FindCulpritForChromeCrash( # Not implemented yet pylint: disable=W0613 |
| 9 channel, platform, signature, stack_trace, |
| 10 crashed_version, versions_to_cpm): |
| 11 """Finds culprits for a Chrome crash. |
| 12 |
| 13 Args: |
| 14 channel (str): The channel name, could be 'dev', 'canary', 'beta', etc. |
| 15 platform (str): The platform name, could be 'win', 'mac', 'linux', |
| 16 'android', 'ios', etc. |
| 17 signature (str): The signature of a crash on the Chrome crash server. |
| 18 stack_trace (str): A string containing the stack trace of a crash. |
| 19 crash_version (str): The version of Chrome in which the crash occurred. |
| 20 versions_to_cpm (dict): Mapping from Chrome version to crash per million |
| 21 page loads. |
| 22 |
| 23 Returns: |
| 24 (analysis_result_dict, tag_dict) |
| 25 The analysis result is a dict like below: |
| 26 { |
| 27 "found": True, # Indicate whether anything is found. |
| 28 "suspected_project_path": "src/v8", # The full path to the dependency. |
| 29 "suspected_project_name": "v8", # A project name of the dependency. |
| 30 "components": ["blink>javascript"], # Components to file bug against. |
| 31 "culprits": [ |
| 32 { |
| 33 "url": "https://chromium.googlesource.com/chromium/.../+/hash", |
| 34 "revision": "commit-hash", |
| 35 "code_review_url": "https://codereview.chromium.org/ISSUE", |
| 36 "project_path": "src/v8", |
| 37 "project_name": "v8", |
| 38 "author": "who@chromium.org", |
| 39 "time": "2015-08-17 03:38:16", # When the revision was committed. |
| 40 "reason": "A plain string with '\n' as line break to explain why", |
| 41 "confidence": "0.6", # Optional confidence score. |
| 42 }, |
| 43 ], |
| 44 } |
| 45 The code review url might not always be available, because not all commits |
| 46 go through code review. In that case, commit url should be used instead. |
| 47 |
| 48 The tag dict are allowed key/value pairs to tag the analysis result for |
| 49 query and monitoring purpose on Findit side. For allowed keys, please |
| 50 refer to crash_analysis.py and fracas_crash_analysis.py: |
| 51 For results with normal culprit-finding algorithm: |
| 52 { |
| 53 'found_suspects': True, |
| 54 'has_regression_range': True, |
| 55 'solution': 'core_algorithm', |
| 56 } |
| 57 For results using git blame without a regression range: |
| 58 { |
| 59 'found_suspects': True, |
| 60 'has_regression_range': False, |
| 61 'solution': 'blame', |
| 62 } |
| 63 If nothing is found: |
| 64 { |
| 65 'found_suspects': False, |
| 66 } |
| 67 """ |
| 68 # TODO (katesonia): hook the analysis logic up here. |
| 69 return {'found': False}, {'found_suspects': False} # pragma: no cover. |
| OLD | NEW |