Bug 1780273 - Use 'filter_tasks' from standalone taskgraph, r=taskgraph-reviewers,aki
authorAndrew Halberstadt <ahal@mozilla.com>
Wed, 20 Jul 2022 13:17:32 +0000
changeset 624513 6ad684910e9885aa57c58191dc09b10f61b3ab36
parent 624512 9c7fdc02ddaa82de714f769ec9afab8a45bdcb68
child 624514 97bac5fe18802f9db0fb6db2d181d341bb015d4c
push id40007
push usersmolnar@mozilla.com
push dateWed, 20 Jul 2022 21:52:02 +0000
treeherdermozilla-central@16a4302fb1a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstaskgraph-reviewers, aki
bugs1780273
milestone104.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 1780273 - Use 'filter_tasks' from standalone taskgraph, r=taskgraph-reviewers,aki Differential Revision: https://phabricator.services.mozilla.com/D152212
taskcluster/gecko_taskgraph/filter_tasks.py
taskcluster/gecko_taskgraph/generator.py
deleted file mode 100644
--- a/taskcluster/gecko_taskgraph/filter_tasks.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-import logging
-
-from . import target_tasks
-
-logger = logging.getLogger(__name__)
-
-filter_task_functions = {}
-
-
-def filter_task(name):
-    """Generator to declare a task filter function."""
-
-    def wrap(func):
-        filter_task_functions[name] = func
-        return func
-
-    return wrap
-
-
-@filter_task("target_tasks_method")
-def filter_target_tasks(graph, parameters, graph_config):
-    """Proxy filter to use legacy target tasks code.
-
-    This should go away once target_tasks are converted to filters.
-    """
-
-    attr = parameters.get("target_tasks_method", "all_tasks")
-    fn = target_tasks.get_method(attr)
-    return fn(graph, parameters, graph_config)
--- a/taskcluster/gecko_taskgraph/generator.py
+++ b/taskcluster/gecko_taskgraph/generator.py
@@ -2,26 +2,26 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import logging
 import os
 import copy
 
 import attr
+from taskgraph import filter_tasks
 from taskgraph.config import GraphConfig
 from taskgraph.graph import Graph
 from taskgraph.parameters import parameters_loader
 from taskgraph.task import Task
 from taskgraph.taskgraph import TaskGraph
 from taskgraph.transforms.base import TransformSequence, TransformConfig
 from taskgraph.util.python_path import find_object
 from taskgraph.util.yaml import load_yaml
 
-from . import filter_tasks
 from .morph import morph
 from .optimize import optimize_task_graph
 from .util.verify import verifications
 from .config import load_graph_config
 
 logger = logging.getLogger(__name__)