Files
firefox/taskcluster/docs/loading.rst
T
Ryan VanderMeulen c41dc43ff0 Backed out 9 changesets (bug 1383880) for decision task bustage.
Backed out changeset 53f5d47a7cb0 (bug 1383880)
Backed out changeset a0abda41172a (bug 1383880)
Backed out changeset 729a7e2091e8 (bug 1383880)
Backed out changeset a33f5a14a471 (bug 1383880)
Backed out changeset 5b10d321cfee (bug 1383880)
Backed out changeset 8056488d8aed (bug 1383880)
Backed out changeset e62c90e3c1e8 (bug 1383880)
Backed out changeset 91f116ce6c2a (bug 1383880)
Backed out changeset 045498bc36c4 (bug 1383880)
2017-09-01 15:37:08 -04:00

44 lines
1.8 KiB
ReStructuredText

Loading Tasks
=============
The full task graph generation involves creating tasks for each kind. Kinds
are ordered to satisfy ``kind-dependencies``, and then the ``loader`` specified
in ``kind.yml`` is used to load the tasks for that kind. It should point to
a Python function like::
def loader(cls, kind, path, config, parameters, loaded_tasks):
pass
The ``kind`` is the name of the kind; the configuration for that kind
named this class.
The ``path`` is the path to the configuration directory for the kind. This
can be used to load extra data, templates, etc.
The ``parameters`` give details on which to base the task generation. See
:ref:`parameters` for details.
At the time this method is called, all kinds on which this kind depends
(that is, specified in the ``kind-dependencies`` key in ``config``)
have already loaded their tasks, and those tasks are available in
the list ``loaded_tasks``.
The return value is a list of inputs to the transforms listed in the kind's
``transforms`` property. The specific format for the input depends on the first
transform - whatever it expects. The final transform should be
``taskgraph.transform.task:transforms``, which produces the output format the
task-graph generation infrastructure expects.
The ``transforms`` key in ``kind.yml`` is further documented in
:doc:`transforms`. For more information on how all of this works, consult the
docstrings and comments in the source code itself.
Try option syntax
-----------------
The ``parse-commit`` optional field specified in ``kind.yml`` links to a
function to parse the command line options in the ``--message`` mach parameter.
Currently, the only valid value is ``taskgraph.try_option_syntax:parse_message``.
The parsed arguments are stored in ``config.config['args']``, it corresponds
to the same object returned by ``parse_args`` from ``argparse`` Python module.