Bug 1381622: refer to JSON-e for template language; r?jonasfj draft
authorDustin J. Mitchell <dustin@mozilla.com>
Mon, 17 Jul 2017 19:12:30 +0000
changeset 610036 34544394dd4f8aa57f169f6f3ffea2073000cf3f
parent 610019 43019e9b078e01aca1a9e963bd9936e7e6a56c9c
child 610037 47921845c13459baea2074367021a53d982532de
child 610656 41da1805e727a4944b1ee6c80f9a1d2a367cf788
push id68767
push userdmitchell@mozilla.com
push dateMon, 17 Jul 2017 20:46:48 +0000
reviewersjonasfj
bugs1381622
milestone56.0a1
Bug 1381622: refer to JSON-e for template language; r?jonasfj MozReview-Commit-ID: 5ufmEfmioqy
taskcluster/docs/action-spec.rst
taskcluster/docs/actions-schema.yml
--- 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": {