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

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

Issue 2338273006: [Findit] Factoring out the components, so they can classify themselves (Closed)
Patch Set: rebasing to remove dependency on crrev.com/2344443005 Created 4 years, 3 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
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 407f9f16420c609683915494f079ef9658abe2cc..4c02b8c4d6bf6eb15769399d3068c3fa53aef15b 100644
--- a/appengine/findit/crash/findit_for_chromecrash.py
+++ b/appengine/findit/crash/findit_for_chromecrash.py
@@ -11,6 +11,7 @@ from crash import detect_regression_range
from crash import findit_for_crash
from crash.fracas_parser import FracasParser
from crash.project_classifier import ProjectClassifier
+from crash.component import Component
from crash.component_classifier import ComponentClassifier
from model.crash.crash_config import CrashConfig
@@ -120,8 +121,16 @@ def FindCulpritForChromeCrash(signature, platform,
crash_stack = stacktrace.crash_stack
suspected_project = ProjectClassifier().Classify(
culprit_results, crash_stack)
- suspected_components = ComponentClassifier().Classify(
- culprit_results, crash_stack)
+
+ component_classifier_config = CrashConfig.Get().compiled_component_classifier
+ suspected_components = ComponentClassifier(
+ # TODO(wrengr): have the config return Component objects directly,
+ # rather than needing to convert them here.
+ [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']
+ ).Classify(culprit_results, crash_stack)
# TODO(http://crbug.com/644411): the caller should convert things to
# JSON, not us.
« no previous file with comments | « appengine/findit/crash/component_classifier.py ('k') | appengine/findit/crash/test/component_classifier_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698