Bug 1431193 - Use taskgraph.parameters.load_parameters_file in mach artifact toolchain. r?dustin
Back when the mach artifact toolchain code was written, there was no
official way to get a default set of parameters for taskgraph
generation. As of
bug 1401199, that is not true anymore, so we can now
use that instead of manually set parameters and hope that doesn't break,
which happened with
bug 1430823. This change should make things more
future proof.
This also reverts the changes from changeset 3a8491857651, which fixed
the same issue in a slightly different way.
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1223,17 +1223,16 @@ class PackageFrontend(MachCommandBase):
unpack_file,
)
from requests.adapters import HTTPAdapter
import redo
import requests
import shutil
from taskgraph.generator import load_graph_config, Kind
- from taskgraph.parameters import Parameters
from taskgraph.util.taskcluster import (
get_artifact_url,
list_artifacts,
)
import yaml
self._set_log_level(verbose)
# Normally, we'd use self.log_manager.enable_unstructured(),
@@ -1330,34 +1329,26 @@ class PackageFrontend(MachCommandBase):
if from_build:
if 'TASK_ID' in os.environ:
self.log(logging.ERROR, 'artifact', {},
'Do not use --from-build in automation; all dependencies '
'should be determined in the decision task.')
return 1
from taskgraph.optimize import IndexSearch
- params = {
- 'message': '',
- 'project': '',
- 'level': os.environ.get('MOZ_SCM_LEVEL', '3'),
- 'base_repository': '',
- 'head_repository': '',
- 'head_rev': '',
- 'moz_build_date': '',
- 'build_date': 0,
- 'pushlog_id': 0,
- 'owner': '',
- }
+ from taskgraph.parameters import Parameters
+ params = Parameters(
+ level=os.environ.get('MOZ_SCM_LEVEL', '3'),
+ strict=False)
# TODO: move to the taskcluster package
def tasks(kind_name):
root_path = mozpath.join(self.topsrcdir, 'taskcluster', 'ci')
graph_config = load_graph_config(root_path)
- tasks = Kind.load(root_path, graph_config, kind_name).load_tasks(Parameters(**params), {})
+ tasks = Kind.load(root_path, graph_config, kind_name).load_tasks(params, {})
return {
task.task['metadata']['name']: task
for task in tasks
}
toolchains = tasks('toolchain')
aliases = {}