From 51aa1fc9fb596e6cb5142f7f6f87046883a2e785 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Mon, 7 Nov 2016 19:13:34 +0000 Subject: [PATCH] Bug 1296842: make target-task related parameters a fixed set; r=jmaher The `from_parameters` method was never used, and let do confusion over the role of these parameters. Now there are only two, and they are always required. MozReview-Commit-ID: AbPqijXucu5 --HG-- extra : rebase_source : 85affd063a543c549afaaa36ce7ee31ed1f943d5 --- taskcluster/docs/parameters.rst | 17 +++-------------- taskcluster/taskgraph/target_tasks.py | 8 -------- taskcluster/taskgraph/test/test_target_tasks.py | 5 ----- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/taskcluster/docs/parameters.rst b/taskcluster/docs/parameters.rst index 5190d9b6f293..8514259cef09 100644 --- a/taskcluster/docs/parameters.rst +++ b/taskcluster/docs/parameters.rst @@ -89,20 +89,9 @@ those in the target set, recursively. In a decision task, this set can be specified programmatically using one of a variety of methods (e.g., parsing try syntax or reading a project-specific configuration file). -The decision task writes its task set to the ``target_tasks.json`` artifact, -and this can be copied into ``parameters.target_tasks`` and -``parameters.target_tasks_method`` set to ``"from_parameters"`` for debugging -with other ``mach taskgraph`` commands. - ``target_tasks_method`` - (optional) The method to use to determine the target task set. This is the - suffix of one of the functions in ``tascluster/taskgraph/target_tasks.py``. - If omitted, all tasks are targeted. - -``target_tasks`` - (optional) The target set method ``from_parameters`` reads the target set, as - a list of task labels, from this parameter. + The method to use to determine the target task set. This is the suffix of + one of the functions in ``tascluster/taskgraph/target_tasks.py``. ``optimize_target_tasks`` - (optional; default True) If true, then target tasks are eligible for - optimization. + If true, then target tasks are eligible for optimization. diff --git a/taskcluster/taskgraph/target_tasks.py b/taskcluster/taskgraph/target_tasks.py index 877e93cf5093..1d2eaf871e87 100644 --- a/taskcluster/taskgraph/target_tasks.py +++ b/taskcluster/taskgraph/target_tasks.py @@ -34,14 +34,6 @@ def get_method(method): return _target_task_methods[method] -@_target_task('from_parameters') -def target_tasks_from_parameters(full_task_graph, parameters): - """Get the target task set from parameters['target_tasks']. This is - useful for re-running a decision task with the same target set as in an - earlier run, by copying `target_tasks.json` into `parameters.yml`.""" - return parameters['target_tasks'] - - @_target_task('try_option_syntax') def target_tasks_try_option_syntax(full_task_graph, parameters): """Generate a list of target tasks based on try syntax in diff --git a/taskcluster/taskgraph/test/test_target_tasks.py b/taskcluster/taskgraph/test/test_target_tasks.py index e997e505c479..035ccefd83f1 100644 --- a/taskcluster/taskgraph/test/test_target_tasks.py +++ b/taskcluster/taskgraph/test/test_target_tasks.py @@ -26,11 +26,6 @@ class FakeTryOptionSyntax(object): class TestTargetTasks(unittest.TestCase): - def test_from_parameters(self): - method = target_tasks.get_method('from_parameters') - self.assertEqual(method(None, {'target_tasks': ['a', 'b']}), - ['a', 'b']) - def default_matches(self, run_on_projects, project): method = target_tasks.get_method('default') graph = TaskGraph(tasks={