Bug 1383880: use a vcs-compatible reader in decision tasks; r=gps
☠☠ backed out by d88e5dec2638 ☠ ☠
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 07 Sep 2017 18:28:22 +0000
changeset 431654 571a6c9054a540e0bf40baf837da9175f21796b9
parent 431653 ec2b8ba5a949c3b899a647dbad93aa60b653e745
child 431655 8cceb6a82bfb079e93005d120f540f0877a0eaf3
push id7785
push userryanvm@gmail.com
push dateThu, 21 Sep 2017 13:39:55 +0000
treeherdermozilla-beta@06d4034a8a03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1383880
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1383880: use a vcs-compatible reader in decision tasks; r=gps This continues to use a file-based reader when run locally. MozReview-Commit-ID: CJuYKDj2E3n
taskcluster/taskgraph/optimize.py
--- a/taskcluster/taskgraph/optimize.py
+++ b/taskcluster/taskgraph/optimize.py
@@ -21,17 +21,17 @@ from collections import defaultdict
 from .graph import Graph
 from . import files_changed
 from .taskgraph import TaskGraph
 from .util.seta import is_low_value_task
 from .util.taskcluster import find_task_id
 from .util.parameterization import resolve_task_references
 from mozbuild.util import memoize
 from slugid import nice as slugid
-from mozbuild.frontend import reader
+from mozbuild.base import MozbuildObject
 
 logger = logging.getLogger(__name__)
 
 TOPSRCDIR = os.path.abspath(os.path.join(__file__, '../../../'))
 
 
 def optimize_task_graph(target_task_graph, params, do_not_optimize,
                         existing_tasks=None, strategies=None):
@@ -353,18 +353,22 @@ class SkipUnlessChanged(OptimizationStra
 
 
 class SkipUnlessSchedules(OptimizationStrategy):
 
     @memoize
     def scheduled_by_push(self, repository, revision):
         changed_files = files_changed.get_changed_files(repository, revision)
 
-        config = reader.EmptyConfig(TOPSRCDIR)
-        rdr = reader.BuildReader(config)
+        mbo = MozbuildObject.from_environment()
+        # the decision task has a sparse checkout, so, mozbuild_reader will use
+        # a MercurialRevisionFinder with revision '.', which should be the same
+        # as `revision`; in other circumstances, it will use a default reader
+        rdr = mbo.mozbuild_reader(config_mode='empty')
+
         components = set()
         for p, m in rdr.files_info(changed_files).items():
             components |= set(m['SCHEDULES'].components)
 
         return components
 
     def should_remove_task(self, task, params, conditions):
         if params.get('pushlog_id') == -1: