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

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: Created 4 years 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..4ad39eeba6b582d311088364a7ad236a958fbdc1 100644
--- a/appengine/findit/crash/findit_for_chromecrash.py
+++ b/appengine/findit/crash/findit_for_chromecrash.py
@@ -54,10 +54,22 @@ class FinditForChromeCrash(Findit):
component_classifier_config = CrashConfig.Get().component_classifier
self._stacktrace_parser = ChromeCrashParser()
+
+ def MutateTheRepo(dep_url): # pragma: no cover
+ """A factory function for returning ``Repository`` objects.
+
+ The current definition captures the functionality of before
+ we actored 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

Powered by Google App Engine
This is Rietveld 408576698