Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/howto/load-task-locally.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ For example, you can run:

.. code-block:: shell

taskgraph morphed -J --tasks test-unit-py | jq -r 'to_entries | first | .value.task' | taskgraph load-task -
taskgraph morphed --format json --tasks test-unit-py | jq -r 'to_entries | first | .value.task' | taskgraph load-task -

In this example, we're piping the definition of the task named ``test-unit-py``
into ``taskgraph load-task``. This allows you to quickly iterate on the task
and test that it runs as expected.

.. note::

The output of ``taskgraph morphed -J`` looks something like:
The output of ``taskgraph morphed --format json`` looks something like:

``{ "<task id>": { "task": { <task definition> }}}``

Expand Down Expand Up @@ -103,7 +103,7 @@ by combining passing in a custom image locally, and piping a task definition via

.. code-block:: shell

taskgraph morphed -J --tasks test-unit-py | jq -r 'to_entries | first | .value.task' | taskgraph load-task --image python -
taskgraph morphed --format json --tasks test-unit-py | jq -r 'to_entries | first | .value.task' | taskgraph load-task --image python -

Developing in the Container
---------------------------
Expand Down
21 changes: 11 additions & 10 deletions docs/howto/run-locally.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ Useful Arguments
Here are some useful arguments accepted by most ``taskgraph`` subcommands. For
a full reference, see :doc:`/reference/cli`.

``-J/--json``
+++++++++++++
``--format``
++++++++++++

By default only the task labels are displayed as output, but when ``-J/--json``
is used, the full JSON representation of all task definitions are displayed.
By default only the task labels are displayed as output, but when
``--format json`` is used, the full JSON representation of all task definitions
are displayed.

.. note::

Using ``-J/--json`` can often result in a massive amount of output. Consider
using the ``--tasks`` and/or ``--target-kind`` flags in conjunction to
filter the result down to a manageable level.
Using ``--format json`` can often result in a massive amount of output.
Consider using the ``--tasks`` and/or ``--target-kind`` flags in conjunction
to filter the result down to a manageable level.

``--tasks/--tasks-regex``
+++++++++++++++++++++++++
Expand Down Expand Up @@ -126,15 +127,15 @@ Validating Changes to Task Definitions

If you're only modifying the definition of tasks, then you want to generate the
``full_task_graph``. This is because task definitions are frozen (with minor
exceptions) after this phase. You'll also want to use the ``-J/--json`` flag and
exceptions) after this phase. You'll also want to use ``--format json`` and
likely also the ``--tasks`` flag to filter down the result.

For example, let's say you modify a task called ``build-android``. Then you
would run the following command:

.. code-block:: shell

taskgraph full -J --tasks "build-android"
taskgraph full --format json --tasks "build-android"

Then you can inspect the resulting task definition and validate that everything
is configured as you expect.
Expand All @@ -148,7 +149,7 @@ If you're modifying *where* a task runs, e.g by changing a key that impacts the
``target_task_graph`` phase.

Unlike when modifying the definition, we don't care about the contents of the
task so passing the ``-J/--json`` flag is unnecessary. Instead, we can simply
task so passing ``--format json`` is unnecessary. Instead, we can simply
inspect whether the label exists or not. However it *is* important to make sure
we're generating under the appropriate context(s) via the ``-p/--parameters``
flag.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ already, namely ``docker-image-linux`` and ``hello-world``.
.. note::

By default the ``taskgraph`` command will only output task labels. Try
adding ``--json`` to the command to see the actual definitions.
adding ``--format json`` to the command to see the actual definitions.

See if you can create a new task by editing ``taskcluster/kinds/hello/kind.yml``,
and re-run ``taskgraph full`` to verify.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/creating-a-task-graph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ Now run:

.. code-block:: bash

taskgraph morphed -J
taskgraph morphed --format json

The ``-J/--json`` flag will display the full JSON definition of your task.
The ``--format json`` flag will display the full JSON definition of your task.
Morphed is the final phase of :ref:`graph generation <graph generation>`, so
represents your task's final form before it would get submitted to Taskcluster.
In fact, if we hadn't made up the trust domain and worker pool in
Expand Down
Loading