| 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 common.chrome_dependency_fetcher import ChromeDependencyFetcher | 10 from common.chrome_dependency_fetcher import ChromeDependencyFetcher |
| 11 from crash import detect_regression_range | 11 from crash import detect_regression_range |
| 12 from crash.chromecrash_parser import ChromeCrashParser | 12 from crash.chromecrash_parser import ChromeCrashParser |
| 13 from crash.chrome_crash_data import ChromeCrashData | 13 from crash.chrome_crash_data import ChromeCrashData |
| 14 from crash.findit import Findit | 14 from crash.findit import Findit |
| 15 from crash.loglinear.changelist_classifier import LogLinearChangelistClassifier | 15 from crash.loglinear.changelist_classifier import LogLinearChangelistClassifier |
| 16 from crash.loglinear.changelist_features.touch_crashed_directory import ( |
| 17 TouchCrashedDirectoryFeature) |
| 16 from crash.loglinear.changelist_features.touch_crashed_file_meta import ( | 18 from crash.loglinear.changelist_features.touch_crashed_file_meta import ( |
| 17 TouchCrashedFileMetaFeature) | 19 TouchCrashedFileMetaFeature) |
| 18 from crash.loglinear.feature import WrapperMetaFeature | 20 from crash.loglinear.feature import WrapperMetaFeature |
| 19 from crash.loglinear.weight import MetaWeight | 21 from crash.loglinear.weight import MetaWeight |
| 20 from crash.loglinear.weight import Weight | 22 from crash.loglinear.weight import Weight |
| 21 from crash.predator import Predator | 23 from crash.predator import Predator |
| 22 from crash.type_enums import CrashClient | 24 from crash.type_enums import CrashClient |
| 23 from model.crash.cracas_crash_analysis import CracasCrashAnalysis | 25 from model.crash.cracas_crash_analysis import CracasCrashAnalysis |
| 24 from model.crash.fracas_crash_analysis import FracasCrashAnalysis | 26 from model.crash.fracas_crash_analysis import FracasCrashAnalysis |
| 25 | 27 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 cls.__name__) | 44 cls.__name__) |
| 43 raise NotImplementedError() | 45 raise NotImplementedError() |
| 44 | 46 |
| 45 def __init__(self, get_repository, config): | 47 def __init__(self, get_repository, config): |
| 46 super(FinditForChromeCrash, self).__init__(get_repository, config) | 48 super(FinditForChromeCrash, self).__init__(get_repository, config) |
| 47 meta_weight = MetaWeight({ | 49 meta_weight = MetaWeight({ |
| 48 'TouchCrashedFileMeta': MetaWeight({ | 50 'TouchCrashedFileMeta': MetaWeight({ |
| 49 'MinDistance': Weight(1.), | 51 'MinDistance': Weight(1.), |
| 50 'TopFrameIndex': Weight(1.), | 52 'TopFrameIndex': Weight(1.), |
| 51 'TouchCrashedFile': Weight(1.), | 53 'TouchCrashedFile': Weight(1.), |
| 52 }) | 54 }), |
| 55 'TouchCrashedDirectory': Weight(1.) |
| 53 }) | 56 }) |
| 54 meta_feature = WrapperMetaFeature( | 57 meta_feature = WrapperMetaFeature( |
| 55 [TouchCrashedFileMetaFeature(get_repository)]) | 58 [TouchCrashedFileMetaFeature(get_repository), |
| 59 TouchCrashedDirectoryFeature()]) |
| 56 | 60 |
| 57 self._predator = Predator(LogLinearChangelistClassifier(get_repository, | 61 self._predator = Predator(LogLinearChangelistClassifier(get_repository, |
| 58 meta_feature, | 62 meta_feature, |
| 59 meta_weight), | 63 meta_weight), |
| 60 self._component_classifier, | 64 self._component_classifier, |
| 61 self._project_classifier) | 65 self._project_classifier) |
| 62 | 66 |
| 63 def _Predator(self): # pragma: no cover | 67 def _Predator(self): # pragma: no cover |
| 64 return self._predator | 68 return self._predator |
| 65 | 69 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 122 |
| 119 def GetAnalysis(self, crash_identifiers): | 123 def GetAnalysis(self, crash_identifiers): |
| 120 # TODO: inline FracasCrashAnalysis.Get stuff here. | 124 # TODO: inline FracasCrashAnalysis.Get stuff here. |
| 121 return FracasCrashAnalysis.Get(crash_identifiers) | 125 return FracasCrashAnalysis.Get(crash_identifiers) |
| 122 | 126 |
| 123 def ProcessResultForPublishing(self, result, key): | 127 def ProcessResultForPublishing(self, result, key): |
| 124 """Fracas specific processing of result data for publishing.""" | 128 """Fracas specific processing of result data for publishing.""" |
| 125 result['feedback_url'] = _FRACAS_FEEDBACK_URL_TEMPLATE % ( | 129 result['feedback_url'] = _FRACAS_FEEDBACK_URL_TEMPLATE % ( |
| 126 appengine_util.GetDefaultVersionHostname(), key) | 130 appengine_util.GetDefaultVersionHostname(), key) |
| 127 return result | 131 return result |
| OLD | NEW |