Bug 1418883: Look in comm-central repository for changed files.
MozReview-Commit-ID: 1p2e7Zbqwtw
--- a/taskcluster/taskgraph/files_changed.py
+++ b/taskcluster/taskgraph/files_changed.py
@@ -6,17 +6,17 @@
Support for optimizing tasks based on the set of files that have changed.
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import requests
from redo import retry
-from mozpack.path import match as mozpackmatch
+from mozpack.path import match as mozpackmatch, join as join_path
logger = logging.getLogger(__name__)
_cache = {}
def get_changed_files(repository, revision):
"""
Get the set of files changed in the push headed by the given revision.
@@ -52,14 +52,27 @@ def check(params, file_patterns):
revision = params.get('head_rev')
if not repository or not revision:
logger.warning("Missing `head_repository` or `head_rev` parameters; "
"assuming all files have changed")
return True
changed_files = get_changed_files(repository, revision)
+ if 'comm_repository' in params:
+ repository = params.get('comm_head_repository')
+ revision = params.get('comm_head_rev')
+ if not revision:
+ logger.warning("Missing `comm_head_rev` parameters; "
+ "assuming all files have changed")
+ return True
+
+ changed_files |= {
+ join_path("comm", file) for file in
+ get_changed_files(repository, revision)
+ }
+
for pattern in file_patterns:
for path in changed_files:
if mozpackmatch(path, pattern):
return True
return False