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

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

Issue 2657913002: [Predator] Add ``Project`` class and ``ClassifySuspect`` method to project and component classifier (Closed)
Patch Set: Fix nits. Created 3 years, 11 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/component_classifier.py ('k') | appengine/findit/crash/predator.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 5cc446275b464f07ea04888e0d245ab41c8bd616..dcb2d3c57f66a6587dfd3fdb607d2be89dc16b52 100644
--- a/appengine/findit/crash/findit_for_chromecrash.py
+++ b/appengine/findit/crash/findit_for_chromecrash.py
@@ -10,10 +10,11 @@ from common import appengine_util
from crash import detect_regression_range
from crash.changelist_classifier import ChangelistClassifier
from crash.chromecrash_parser import ChromeCrashParser
-from crash.component_classifier import Component
+from crash.component import Component
from crash.component_classifier import ComponentClassifier
from crash.findit import Findit
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
@@ -51,10 +52,17 @@ class FinditForChromeCrash(Findit):
# entirely, by passing the relevant data as arguments to this constructor.
def __init__(self, get_repository):
super(FinditForChromeCrash, self).__init__(get_repository)
+ project_classifier_config = CrashConfig.Get().project_classifier
component_classifier_config = CrashConfig.Get().component_classifier
self._stacktrace_parser = ChromeCrashParser()
+ 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']]
+ 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 components we should return as
# components suggestion results.
# TODO(http://crbug.com/679964) Deprecate the scorer-based changelist
@@ -62,11 +70,10 @@ class FinditForChromeCrash(Findit):
self._predator = Predator(
cl_classifier = ChangelistClassifier(get_repository),
component_classifier = ComponentClassifier(
- [Component(component_name, path_regex, function_regex)
- for path_regex, function_regex, component_name
- in component_classifier_config['path_function_component']],
- component_classifier_config['top_n']),
- project_classifier = ProjectClassifier())
+ components, component_classifier_config['top_n']),
+ project_classifier = ProjectClassifier(
+ projects, project_classifier_config['top_n'],
+ project_classifier_config['non_chromium_project_rank_priority']))
def _InitializeAnalysis(self, model, crash_data):
super(FinditForChromeCrash, self)._InitializeAnalysis(model, crash_data)
« no previous file with comments | « appengine/findit/crash/component_classifier.py ('k') | appengine/findit/crash/predator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698