Bug 1381622: refer to JSON-e for template language; r?jonasfj
MozReview-Commit-ID: 5ufmEfmioqy
--- a/taskcluster/docs/action-spec.rst
+++ b/taskcluster/docs/action-spec.rst
@@ -167,35 +167,19 @@ The template is parameterized with the f
the task definition of the selected task, ``null`` if no task is
selected (this is the case if the action has ``context: []``), and,
``input``
the input matching the ``schema`` property, ``null`` if the action
doesn't have a ``schema`` property.
``<key>``
Any ``<key>`` defined in the ``variables`` property may also be referenced.
-The template is an object that is parameterized by:
-
-1. Replacing substrings ``'${variable}'`` in strings and object keys
- with the value of the given ``variable``.
-2. Replacing objects on the form ``{$eval: 'variable'}`` with the
- value of of the given ``variable``.
-3. Replacing objects on the form ``{$fromNow: 'timespan'}`` with a
- timestamp of ``timespan`` from now. Where ``timespan`` is on the
- form: ``([0-9]+ *d(ays?)?)? *([0-9]+ *h(ours?)?)? *([0-9]+ *m(in(utes?)?)?)?``
-4. Replacing any object on the form ``{$json: value}`` with the
- value of ``JSON.stringify(result)`` where ``result`` is the result
- of recursive application of rules 1-4 on `value`.
-
-.. warning::
- The template language is currently under active development and additional
- features will be added in the future. Once feature complete the template
- language will be frozen to avoid breaking backwards compatibility for user
- interface implementors. See `JSON-E <https://github.com/taskcluster/json-e>`_
- for details.
+The template is an object that is parameterized using `JSON-e
+<https://github.com/taskcluster/json-e>`_, with the above variables supplied as
+context.
The following **example** demonstrates how a task template can specify
timestamps and dump input JSON into environment variables::
{
"workerType": "my-worker",
"payload": {
"created": {"$fromNow": ""},
--- a/taskcluster/docs/actions-schema.yml
+++ b/taskcluster/docs/actions-schema.yml
@@ -141,40 +141,19 @@ properties:
description: |
Task template for triggering the action.
When an action have been selected in the appropriate context and
input satisfying the `schema` (if any) has been collected. The
action is triggered by parameterizing the task template given in
this property, and creating the resulting task.
- The template is parameterized with the following variables:
- * `taskGroupId`
- * `taskId` (taskId, `null` if not triggered for a given task)
- * `task` (task definition, `null` if not triggered for a given task)
- * `input` (input matching `schema`, `null` if no schema is given)
- * Property defined in the `variables` property.
-
- The template is an object that is parameterized by:
- 1. Replacing substrings `'${variable}'` in strings and object keys
- with the value of the given `variable`.
- 2. Replacing objects on the form `{$eval: 'variable'}` with the
- value of of the given `variable`.
- 3. Replacing objects on the form {$fromNow: 'timespan'} with a
- timestamp of `timespan` from now. Where `timespan` is on the
- form: `([0-9]+ *d(ays?)?)? *([0-9]+ *h(ours?)?)? *([0-9]+ *m(in(utes?)?)?)?`
- 4. Replacing any object on the form `{$json: value}` with the
- value of `JSON.stringify(result)` where `result` is the result
- of recursive application of rules 1-4 on `value`.
-
- This template language is still incomplete and additional features
- will be added in the future. This statment will be changed when the
- features of the template language is locked, until then consumption
- of the `public/actions.json` artifact is experimental.
- # TODO: Freeze the template language with a specification of json-e
+ The template is an object that is parameterized using
+ [JSON-e](https://github.com/taskcluster/json-e), with the above
+ variables supplied as context.
This allows for dumping `input` and `taskId` into environment
variables for the task to be created. The following task template
injects `input` and `taskId` as environment variables:
```json
{
"workerType": "my-worker",
"payload": {