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

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

Issue 2608483002: Changed FindSuspects to take a Repository factory, rather than mutating it (Closed)
Patch Set: rebase Created 3 years, 12 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 cda20e6aaa87d645675b9a366c082413e90d52fa..c50fe2d6a34dc9168ac3840d02664924710ef0c4 100644
--- a/appengine/findit/crash/findit_for_chromecrash.py
+++ b/appengine/findit/crash/findit_for_chromecrash.py
@@ -54,10 +54,23 @@ class FinditForChromeCrash(Findit):
component_classifier_config = CrashConfig.Get().component_classifier
self._stacktrace_parser = ChromeCrashParser()
+
+ # TODO(crbug.com/677224): should replace this with an actual factory.
+ def MutateTheRepo(dep_url): # pragma: no cover
+ """A factory function for returning ``Repository`` objects.
+
+ The current definition captures the functionality of before
+ we factored out this factory method. That is, it's not really a
+ "factory" but rather mutates the main repo object in place. In
+ the future this should be changed to do the right thing instead.
+ """
+ repository.repo_url = dep_url
+ return repository
+
# The top_n is the number of components we should return as
# components suggestion results.
self._predator = Predator(
- cl_classifier = ChangelistClassifier(repository = repository),
+ cl_classifier = ChangelistClassifier(repository, MutateTheRepo),
component_classifier = ComponentClassifier(
[Component(component_name, path_regex, function_regex)
for path_regex, function_regex, component_name
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/crash/loglinear/changelist_classifier.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698