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

Unified Diff: appengine/findit/waterfall/extract_deps_info_pipeline.py

Issue 2605943002: Removing the mutation in the factories for getting dep repositories (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/waterfall/extract_deps_info_pipeline.py
diff --git a/appengine/findit/waterfall/extract_deps_info_pipeline.py b/appengine/findit/waterfall/extract_deps_info_pipeline.py
index 6389265f1044db9ea8dca815b244c3d97732a91c..351a09fd74441eef64d7aba086b7df56a030ef90 100644
--- a/appengine/findit/waterfall/extract_deps_info_pipeline.py
+++ b/appengine/findit/waterfall/extract_deps_info_pipeline.py
@@ -43,11 +43,16 @@ def _GetOSPlatformName(master_name, builder_name): # pragma: no cover
return 'all' # Default to all platform.
+def _CachedGitilesRepositoryFactory(repo_url): # pragma: no cover
Sharu Jiang 2016/12/28 23:05:12 Ditto, we have this in 3 different places, how abo
wrengr 2016/12/29 20:57:31 Done.
+ return cached_gitiles_repository.CachedGitilesRepository(
+ HttpClientAppengine(), repo_url)
+
+
def _GetDependencies(chromium_revision, os_platform):
"""Returns the dependencies used by the specified chromium revision."""
deps = {}
- dep_fetcher=chrome_dependency_fetcher.ChromeDependencyFetcher(
- cached_gitiles_repository.CachedGitilesRepository(HttpClientAppengine()))
+ dep_fetcher = chrome_dependency_fetcher.ChromeDependencyFetcher(
+ _CachedGitilesRepositoryFactory)
for path, dependency in dep_fetcher.GetDependency(
chromium_revision, os_platform).iteritems():
deps[path] = {
@@ -80,8 +85,8 @@ def _DetectDependencyRolls(change_logs, os_platform):
}
"""
deps_rolls = {}
- dep_fetcher=chrome_dependency_fetcher.ChromeDependencyFetcher(
- cached_gitiles_repository.CachedGitilesRepository(HttpClientAppengine()))
+ dep_fetcher = chrome_dependency_fetcher.ChromeDependencyFetcher(
+ _CachedGitilesRepositoryFactory)
for revision, change_log in change_logs.iteritems():
# Check DEPS roll only if the chromium DEPS file is changed by the CL.
for touched_file in change_log['touched_files']:

Powered by Google App Engine
This is Rietveld 408576698