Bug 1780273 - Use target_task method registration from standalone taskgraph, r=taskgraph-reviewers,aki

Differential Revision: https://phabricator.services.mozilla.com/D152211
This commit is contained in:
Andrew Halberstadt 2022-07-20 13:17:32 +00:00
Родитель e396382faf
Коммит 9d3c858dfa
2 изменённых файлов: 4 добавлений и 15 удалений

Просмотреть файл

@ -41,5 +41,8 @@ def register(graph_config):
graph_config: The graph configuration object.
"""
from gecko_taskgraph.parameters import register_parameters
from gecko_taskgraph import ( # noqa: trigger target task method registration
target_tasks,
)
register_parameters()

Просмотреть файл

@ -10,6 +10,7 @@ import re
from redo import retry
from taskgraph.parameters import Parameters
from taskgraph.target_tasks import _target_task, get_method
from taskgraph.util.taskcluster import find_task_id
from gecko_taskgraph import try_option_syntax, GECKO
@ -21,8 +22,6 @@ from gecko_taskgraph.util.platforms import platform_family
from gecko_taskgraph.util.hg import find_hg_revision_push_info, get_hg_commit_message
_target_task_methods = {}
# Some tasks show up in the target task set, but are possibly special cases,
# uncommon tasks, or tasks running against limited hardware set that they
# should only be selectable with --full.
@ -50,19 +49,6 @@ UNCOMMON_TRY_TASK_LABELS = [
]
def _target_task(name):
def wrap(func):
_target_task_methods[name] = func
return func
return wrap
def get_method(method):
"""Get a target_task_method to pass to a TaskGraphGenerator."""
return _target_task_methods[method]
def index_exists(index_path, reason=""):
print(f"Looking for existing index {index_path} {reason}...")
try: