Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: appengine/findit/crash/findit_for_chromecrash.py

Issue 2673993003: [Predator] Pass config as argument to findit. (Closed)
Patch Set: Fix pylint. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/findit.py ('k') | appengine/findit/crash/test/findit_for_chromecrash_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/findit_for_chromecrash.py
diff --git a/appengine/findit/crash/findit_for_chromecrash.py b/appengine/findit/crash/findit_for_chromecrash.py
index e897f8090d2b57200631108582862fb297effa7e..020922aab8d593661d12c6fb4c3d316da85703f1 100644
--- a/appengine/findit/crash/findit_for_chromecrash.py
+++ b/appengine/findit/crash/findit_for_chromecrash.py
@@ -9,8 +9,6 @@ from google.appengine.ext import ndb
from common import appengine_util
from crash import detect_regression_range
from crash.chromecrash_parser import ChromeCrashParser
-from crash.component import Component
-from crash.component_classifier import ComponentClassifier
from crash.findit import Findit
from crash.loglinear.changelist_classifier import LogLinearChangelistClassifier
from crash.loglinear.changelist_features.touch_crashed_file_meta import (
@@ -19,8 +17,6 @@ from crash.loglinear.feature import WrapperMetaFeature
from crash.loglinear.weight import MetaWeight
from crash.loglinear.weight import Weight
from crash.predator import Predator
-from crash.project import Project
-from crash.project_classifier import ProjectClassifier
from crash.type_enums import CrashClient
from model.crash.cracas_crash_analysis import CracasCrashAnalysis
from model.crash.crash_config import CrashConfig
@@ -54,10 +50,8 @@ class FinditForChromeCrash(Findit):
cls.__name__)
raise NotImplementedError()
- # TODO(http://crbug.com/659354): remove the dependency on CrashConfig
- # entirely, by passing the relevant data as arguments to this constructor.
- def __init__(self, get_repository):
- super(FinditForChromeCrash, self).__init__(get_repository)
+ def __init__(self, get_repository, config):
+ super(FinditForChromeCrash, self).__init__(get_repository, config)
# TODO(http://crbug.com/687670): Move meta weight initial value to config.
meta_weight = MetaWeight({
@@ -70,26 +64,14 @@ class FinditForChromeCrash(Findit):
meta_feature = WrapperMetaFeature(
[TouchCrashedFileMetaFeature(get_repository)])
- project_classifier_config = CrashConfig.Get().project_classifier
- projects = [Project(name, path_regexs, function_regexs, host_directories)
- for name, path_regexs, function_regexs, host_directories
- in project_classifier_config['project_path_function_hosts']]
- component_classifier_config = CrashConfig.Get().component_classifier
- components = [Component(component_name, path_regex, function_regex)
- for path_regex, function_regex, component_name
- in component_classifier_config['path_function_component']]
-
# The top_n is the number of frames we want to check to get component or
# project classifications.
self._predator = Predator(
cl_classifier = LogLinearChangelistClassifier(get_repository,
meta_feature,
meta_weight),
- component_classifier = ComponentClassifier(
- components, component_classifier_config['top_n']),
- project_classifier = ProjectClassifier(
- projects, project_classifier_config['top_n'],
- project_classifier_config['non_chromium_project_rank_priority']))
+ project_classifier = self._project_classifier,
+ component_classifier = self._component_classifier)
self._stacktrace_parser = ChromeCrashParser()
@@ -132,7 +114,7 @@ class FinditForChromeCrash(Findit):
channel = crash_data.get('customized_data', {}).get('channel', None)
# TODO(katesonia): Remove the default value after adding validity check to
# config.
- if platform not in self.config.get(
+ if platform not in self.client_config.get(
'supported_platform_list_by_channel', {}).get(channel, []):
# Bail out if either the channel or platform is not supported yet.
logging.info('Analysis of channel %s, platform %s is not supported. '
@@ -144,7 +126,8 @@ class FinditForChromeCrash(Findit):
# TODO(wrengr): can this blacklist stuff be lifted to the base class?
# TODO(katesonia): Remove the default value after adding validity check to
# config.
- for blacklist_marker in self.config.get('signature_blacklist_markers', []):
+ for blacklist_marker in self.client_config.get(
+ 'signature_blacklist_markers', []):
if blacklist_marker in signature:
logging.info('%s signature is not supported. '
'No analysis is scheduled for %s', blacklist_marker,
« no previous file with comments | « appengine/findit/crash/findit.py ('k') | appengine/findit/crash/test/findit_for_chromecrash_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698