| 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 | 6 |
| 7 from google.appengine.ext import ndb | 7 from google.appengine.ext import ndb |
| 8 | 8 |
| 9 from common import appengine_util | 9 from common import appengine_util |
| 10 from crash import detect_regression_range | 10 from crash import detect_regression_range |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 # TODO(http://crbug.com/659354): remove the dependency on CrashConfig | 50 # TODO(http://crbug.com/659354): remove the dependency on CrashConfig |
| 51 # entirely, by passing the relevant data as arguments to this constructor. | 51 # entirely, by passing the relevant data as arguments to this constructor. |
| 52 def __init__(self, get_repository): | 52 def __init__(self, get_repository): |
| 53 super(FinditForChromeCrash, self).__init__(get_repository) | 53 super(FinditForChromeCrash, self).__init__(get_repository) |
| 54 component_classifier_config = CrashConfig.Get().component_classifier | 54 component_classifier_config = CrashConfig.Get().component_classifier |
| 55 | 55 |
| 56 self._stacktrace_parser = ChromeCrashParser() | 56 self._stacktrace_parser = ChromeCrashParser() |
| 57 | 57 |
| 58 # The top_n is the number of components we should return as | 58 # The top_n is the number of components we should return as |
| 59 # components suggestion results. | 59 # components suggestion results. |
| 60 # TODO(http://crbug.com/679964) Deprecate the scorer-based changelist |
| 61 # classifier and use loglinear model instead. |
| 60 self._predator = Predator( | 62 self._predator = Predator( |
| 61 cl_classifier = ChangelistClassifier(get_repository), | 63 cl_classifier = ChangelistClassifier(get_repository), |
| 62 component_classifier = ComponentClassifier( | 64 component_classifier = ComponentClassifier( |
| 63 [Component(component_name, path_regex, function_regex) | 65 [Component(component_name, path_regex, function_regex) |
| 64 for path_regex, function_regex, component_name | 66 for path_regex, function_regex, component_name |
| 65 in component_classifier_config['path_function_component']], | 67 in component_classifier_config['path_function_component']], |
| 66 component_classifier_config['top_n']), | 68 component_classifier_config['top_n']), |
| 67 project_classifier = ProjectClassifier()) | 69 project_classifier = ProjectClassifier()) |
| 68 | 70 |
| 69 def _InitializeAnalysis(self, model, crash_data): | 71 def _InitializeAnalysis(self, model, crash_data): |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 169 |
| 168 def GetAnalysis(self, crash_identifiers): | 170 def GetAnalysis(self, crash_identifiers): |
| 169 # TODO: inline FracasCrashAnalysis.Get stuff here. | 171 # TODO: inline FracasCrashAnalysis.Get stuff here. |
| 170 return FracasCrashAnalysis.Get(crash_identifiers) | 172 return FracasCrashAnalysis.Get(crash_identifiers) |
| 171 | 173 |
| 172 def ProcessResultForPublishing(self, result, key): | 174 def ProcessResultForPublishing(self, result, key): |
| 173 """Fracas specific processing of result data for publishing.""" | 175 """Fracas specific processing of result data for publishing.""" |
| 174 result['feedback_url'] = _FRACAS_FEEDBACK_URL_TEMPLATE % ( | 176 result['feedback_url'] = _FRACAS_FEEDBACK_URL_TEMPLATE % ( |
| 175 appengine_util.GetDefaultVersionHostname(), key) | 177 appengine_util.GetDefaultVersionHostname(), key) |
| 176 return result | 178 return result |
| OLD | NEW |