Bug 1296842: make target-task related parameters a fixed set; r=jmaher
authorDustin J. Mitchell <dustin@mozilla.com>
Mon, 07 Nov 2016 19:13:34 +0000
changeset 321501 f29234ab0d3c57a374824bec5278fe6c37f561be
parent 321500 8d60c718ff153d8982141e93414e1a412996291a
child 321502 126467fa0641535597213dd494aec402bd47c5ff
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersjmaher
bugs1296842
milestone52.0a1
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
taskcluster/docs/parameters.rst
taskcluster/taskgraph/target_tasks.py
taskcluster/taskgraph/test/test_target_tasks.py
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -84,25 +84,14 @@ Target Set
 ----------
 
 The "target set" is the set of task labels which must be included in a task
 graph.  The task graph generation process will include any tasks required by
 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.
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -29,24 +29,16 @@ def _target_task(name):
     return wrap
 
 
 def get_method(method):
     """Get a target_task_method to pass to a TaskGraphGenerator."""
     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
     parameters['message'] and, for context, the full task graph."""
     options = try_option_syntax.TryOptionSyntax(parameters['message'], full_task_graph)
     target_tasks_labels = [t.label for t in full_task_graph.tasks.itervalues()
                            if options.task_matches(t.attributes)]
 
--- a/taskcluster/taskgraph/test/test_target_tasks.py
+++ b/taskcluster/taskgraph/test/test_target_tasks.py
@@ -21,21 +21,16 @@ class FakeTryOptionSyntax(object):
         self.notifications = None
 
     def task_matches(self, attributes):
         return 'at-at' in attributes
 
 
 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={
             'a': TestTask(kind='build', label='a',
                           attributes={'run_on_projects': run_on_projects}),
         }, graph=Graph(nodes={'a'}, edges=set()))
         parameters = {'project': project}
         return 'a' in method(graph, parameters)