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

Unified Diff: appengine/findit/common/chromium_deps.py

Issue 1154593005: [Findit] Add a sub-pipeline to analyze failures caused by DEPS rolls. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix url to changes in DEPS roll. Created 5 years, 7 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 | « no previous file | appengine/findit/common/dependency.py » ('j') | appengine/findit/common/dependency.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/common/chromium_deps.py
diff --git a/appengine/findit/common/chromium_deps.py b/appengine/findit/common/chromium_deps.py
index 079d67e2dd063fcd74b513c0b80d0510fb626c2d..df0e345dad9578b32c2bc139cf9ff7e1ea327b80 100644
--- a/appengine/findit/common/chromium_deps.py
+++ b/appengine/findit/common/chromium_deps.py
@@ -9,7 +9,7 @@ from common import deps_parser
class DEPSDownloader(deps_parser.DEPSLoader):
- """Download DEPS from remote GIT repo."""
+ """Downloads DEPS from remote GIT repo."""
qyearsley 2015/05/29 23:14:33 GIT -> git or Git
stgao 2015/05/30 00:21:05 Done.
def Load(self, repo_url, revision, deps_file):
http_client = http_client_appengine.HttpClientAppengine()
@@ -35,7 +35,7 @@ class DEPSDownloader(deps_parser.DEPSLoader):
def GetChromeDependency(revision, os_platform):
- """Return all dependencies of Chrome as a dict for the given revision and os.
+ """Returns all dependencies of Chrome as a dict for the given revision and os.
qyearsley 2015/05/29 23:14:33 Nit: os -> OS
stgao 2015/05/30 00:21:05 Done.
Args:
revision (str): The revision of a Chrome build.
@@ -54,11 +54,43 @@ def GetChromeDependency(revision, os_platform):
dependencies = {}
# Flatten the dependency tree into a one-level dict.
- def _FlattenDepTree(dep):
+ def FlattenDepTree(dep):
dependencies[dep.path] = dep
for child in dep.children.values():
- _FlattenDepTree(child)
+ FlattenDepTree(child)
- _FlattenDepTree(root_dep)
+ FlattenDepTree(root_dep)
return dependencies
+
+
+def GetChromiumDEPSRolls(old_cr_revision, new_cr_revision, os_platform):
+ """Returns a list of dependency rolls between the given Chromium revisions.
+
+ Args:
+ old_cr_revision (str): The old Chromium revision.
+ new_cr_revision (str): The new Chromium revision.
qyearsley 2015/05/29 23:14:33 Are these git commit hashes or commit positions or
stgao 2015/05/30 00:21:05 Done. Git commit hashes.
+ os_platform (str): The target OS platform of the Chrome or test binary.
+ """
+ old_deps = GetChromeDependency(old_cr_revision, os_platform)
+ new_deps = GetChromeDependency(new_cr_revision, os_platform)
+
+ rolls = []
+
+ for path, new_dep in new_deps.iteritems():
+ if path == 'src/':
+ continue
+
+ old_revision = None
+ if path in old_deps:
+ old_revision = old_deps[path].revision
+
+ if old_revision != new_dep.revision:
+ rolls.append(
+ dependency.DependencyRoll(
+ path, new_dep.repo_url, old_revision, new_dep.revision))
+
+ # Note: dependencies could be deleted too. However, regressions caused by that
+ # seems rare. Thus, ignore them for now.
+
+ return rolls
« no previous file with comments | « no previous file | appengine/findit/common/dependency.py » ('j') | appengine/findit/common/dependency.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698