Chromium Code Reviews| 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 import logging | 5 import logging |
| 6 from collections import namedtuple | 6 from collections import namedtuple |
| 7 | 7 |
| 8 from common import chromium_deps | 8 from common import chromium_deps |
| 9 from crash import detect_regression_range | 9 from crash import detect_regression_range |
| 10 from crash import findit_for_crash | 10 from crash import findit_for_crash |
| 11 from crash.chromecrash_parser import ChromeCrashParser | 11 from crash.chromecrash_parser import ChromeCrashParser |
| 12 from crash.project_classifier import ProjectClassifier | 12 from crash.project_classifier import ProjectClassifier |
| 13 from crash.component_classifier import Component | 13 from crash.component_classifier import Component |
| 14 from crash.component_classifier import ComponentClassifier | 14 from crash.component_classifier import ComponentClassifier |
| 15 from model.crash.crash_config import CrashConfig | 15 from model.crash.crash_config import CrashConfig |
| 16 | 16 |
| 17 # TODO(katesonia): Remove the default value after adding validity check to | 17 # TODO(katesonia): Remove the default value after adding validity check to |
| 18 # config. | 18 # config. |
| 19 _DEFAULT_TOP_N = 7 | 19 _DEFAULT_TOP_N = 7 |
| 20 | 20 |
| 21 | 21 |
| 22 # TODO(wrengr): move this to its own file, so it can be shared. When we do | 22 # TODO(wrengr): move this to its own file, so it can be shared. When we do |
| 23 # so, we'll need to also pass in the 'solution' argument for the tag_dict. | 23 # so, we'll need to also pass in the 'solution' argument for the tag_dict. |
| 24 class Culprit(namedtuple('Culprit', | 24 class Culprit(namedtuple('Culprit', |
| 25 ['project', 'components', 'cls', 'regression_range'])): | 25 ['project', 'components', 'cls', 'regression_range'])): |
| 26 | 26 |
| 27 @property | |
| 28 def fields(self): | |
|
wrengr
2016/10/11 22:57:43
What's the purpose of this? Since _fields is a pri
Sharu Jiang
2016/10/12 01:18:20
This is used in delta test, and later may used to
wrengr
2016/10/12 20:15:17
I still don't understand. Why can't delta use _fie
Sharu Jiang
2016/10/12 22:58:27
shouldn't _fields supposed to be private and not u
wrengr
2016/10/24 18:09:06
(FWIW, whenever I talk about "client code" or "cli
stgao
2016/10/24 18:17:26
+1 for Wren's suggestion here
Sharu Jiang
2016/10/24 18:50:20
I agree on what you said about the serializing cul
wrengr
2016/10/24 21:22:56
Things with a single underscore are generally "pro
| |
| 29 return self._fields | |
| 30 | |
| 27 # TODO(wrengr): better name for this method. | 31 # TODO(wrengr): better name for this method. |
| 28 def ToDicts(self): | 32 def ToDicts(self): |
| 29 """Convert this object to a pair of anonymous dicts for JSON. | 33 """Convert this object to a pair of anonymous dicts for JSON. |
| 30 | 34 |
| 31 Returns: | 35 Returns: |
| 32 (analysis_result_dict, tag_dict) | 36 (analysis_result_dict, tag_dict) |
| 33 The analysis result is a dict like below: | 37 The analysis result is a dict like below: |
| 34 { | 38 { |
| 35 # Indicate if Findit found any suspects_cls, project, | 39 # Indicate if Findit found any suspects_cls, project, |
| 36 # components or regression_range. | 40 # components or regression_range. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 | 212 |
| 209 crash_stack = stacktrace.crash_stack | 213 crash_stack = stacktrace.crash_stack |
| 210 suspected_project = self.project_classifier.Classify( | 214 suspected_project = self.project_classifier.Classify( |
| 211 suspected_cls, crash_stack) | 215 suspected_cls, crash_stack) |
| 212 | 216 |
| 213 suspected_components = self.component_classifier.Classify( | 217 suspected_components = self.component_classifier.Classify( |
| 214 suspected_cls, crash_stack) | 218 suspected_cls, crash_stack) |
| 215 | 219 |
| 216 return Culprit(suspected_project, suspected_components, suspected_cls, | 220 return Culprit(suspected_project, suspected_components, suspected_cls, |
| 217 regression_range) | 221 regression_range) |
| OLD | NEW |