| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 """Process crashes from Chrome crash server and find culprits for them.""" | 5 """Process crashes from Chrome crash server and find culprits for them.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from common import chromium_deps | 9 from common import chromium_deps |
| 10 from crash import detect_regression_range | 10 from crash import detect_regression_range |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 signature (str): The signature of a crash on the Chrome crash server. | 30 signature (str): The signature of a crash on the Chrome crash server. |
| 31 stack_trace (str): A string containing the stack trace of a crash. | 31 stack_trace (str): A string containing the stack trace of a crash. |
| 32 crash_version (str): The version of Chrome in which the crash occurred. | 32 crash_version (str): The version of Chrome in which the crash occurred. |
| 33 historic_metadata (list): list of dicts mapping from Chrome version to | 33 historic_metadata (list): list of dicts mapping from Chrome version to |
| 34 historic metadata. | 34 historic metadata. |
| 35 | 35 |
| 36 Returns: | 36 Returns: |
| 37 (analysis_result_dict, tag_dict) | 37 (analysis_result_dict, tag_dict) |
| 38 The analysis result is a dict like below: | 38 The analysis result is a dict like below: |
| 39 { | 39 { |
| 40 "found": true, # Indicate whether Findit found any suspects. | 40 # Indicate if Findit found any suspects_cls, suspected_project, |
| 41 # suspected_components or regression_range. |
| 42 "found": true, |
| 41 "suspected_project": "chromium-v8", # Which project is most suspected. | 43 "suspected_project": "chromium-v8", # Which project is most suspected. |
| 42 "feedback_url": "https://.." | 44 "feedback_url": "https://.." |
| 43 "suspected_cls": [ | 45 "suspected_cls": [ |
| 44 { | 46 { |
| 45 "revision": "commit-hash", | 47 "revision": "commit-hash", |
| 46 "url": "https://chromium.googlesource.com/chromium/src/+/ha...", | 48 "url": "https://chromium.googlesource.com/chromium/src/+/ha...", |
| 47 "review_url": "https://codereview.chromium.org/issue-number", | 49 "review_url": "https://codereview.chromium.org/issue-number", |
| 48 "project_path": "third_party/pdfium", | 50 "project_path": "third_party/pdfium", |
| 49 "author": "who@chromium.org", | 51 "author": "who@chromium.org", |
| 50 "time": "2015-08-17 03:38:16", | 52 "time": "2015-08-17 03:38:16", |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 component_classifier_config['top_n'] | 142 component_classifier_config['top_n'] |
| 141 ).Classify(culprit_results, crash_stack) | 143 ).Classify(culprit_results, crash_stack) |
| 142 | 144 |
| 143 # TODO(http://crbug.com/644411): the caller should convert things to | 145 # TODO(http://crbug.com/644411): the caller should convert things to |
| 144 # JSON, not us. | 146 # JSON, not us. |
| 145 culprit_results_list = [result.ToDict() for result in culprit_results] | 147 culprit_results_list = [result.ToDict() for result in culprit_results] |
| 146 | 148 |
| 147 return ( | 149 return ( |
| 148 { | 150 { |
| 149 'found': (bool(suspected_project) or bool(suspected_components) or | 151 'found': (bool(suspected_project) or bool(suspected_components) or |
| 150 bool(culprit_results_list)), | 152 bool(culprit_results_list) or bool(regression_versions)), |
| 151 'regression_range': regression_versions, | 153 'regression_range': regression_versions, |
| 152 'suspected_project': suspected_project, | 154 'suspected_project': suspected_project, |
| 153 'suspected_components': suspected_components, | 155 'suspected_components': suspected_components, |
| 154 'suspected_cls': culprit_results_list, | 156 'suspected_cls': culprit_results_list, |
| 155 }, | 157 }, |
| 156 { | 158 { |
| 157 'found_suspects': bool(culprit_results_list), | 159 'found_suspects': bool(culprit_results_list), |
| 160 'found_project': bool(suspected_project), |
| 161 'found_components': bool(suspected_components), |
| 158 'has_regression_range': bool(regression_versions), | 162 'has_regression_range': bool(regression_versions), |
| 159 'solution': 'core_algorithm', | 163 'solution': 'core_algorithm', |
| 160 } | 164 } |
| 161 ) | 165 ) |
| OLD | NEW |