Bug 1634174: Use `try_task_config.json` file from ci-configuration; r=aki
authorTom Prince <mozilla@hocat.ca>
Thu, 30 Apr 2020 18:58:49 +0000
changeset 220 9c9a898b351909b2e0fe8420ac9d649ded523af3
parent 219 ce7ae9a988cd41bf9ab5852ba8923cc43e62ea34
child 221 815a494bbe2794789999e1c7d78131ecd620883f
push id158
push usermozilla@hocat.ca
push dateThu, 30 Apr 2020 19:02:43 +0000
treeherderci-admin@9c9a898b3519 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki
bugs1634174
Bug 1634174: Use `try_task_config.json` file from ci-configuration; r=aki Differential Revision: https://phabricator.services.mozilla.com/D73138
.taskcluster.yml
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -5,17 +5,17 @@
 ---
 version: 1
 tasks:
     # NOTE: support for actions in ci-admin requires that the `tasks` property be an array *before* JSON-e rendering
     # takes place.
     - $let:
           taskgraph:
               branch: taskgraph
-              revision: 1da560bf0f94c62be4bd539b3ad67fd89658d20a
+              revision: 46dff43505e38d5f5d4ac34fa3adfc3ae871cb9a
           trustDomain: ci
       in:
           $if: 'tasks_for in ["hg-push", "action", "cron"]'
           then:
               $let:
                   # sometimes the push user is just `ffxbld` or the like, but we want an email-like field..
                   ownerEmail: {$if: '"@" in push.owner', then: '${push.owner}', else: '${push.owner}@noreply.mozilla.org'}
                   # ensure there's no trailing `/` on the repo URL
@@ -130,16 +130,17 @@ tasks:
                                     CONFIG_HEAD_REPOSITORY: '${repoUrl}'
                                     CONFIG_HEAD_REF: '${push.revision}'
                                     CONFIG_HEAD_REV: '${push.revision}'
                                     CONFIG_REPOSITORY_TYPE: hg
                                     ADMIN_BASE_REPOSITORY: 'https://hg.mozilla.org/ci/ci-admin'
                                     ADMIN_HEAD_REPOSITORY: 'https://hg.mozilla.org/ci/ci-admin'
                                     ADMIN_HEAD_REF: 'default'
                                     ADMIN_REPOSITORY_TYPE: hg
+                                    TRY_TASK_CONFIG_FILE: 'config/try_task_config.json'
                               - TASKGRAPH_BASE_REPOSITORY: https://hg.mozilla.org/ci/taskgraph
                                 TASKGRAPH_HEAD_REPOSITORY: https://hg.mozilla.org/ci/${taskgraph.branch}
                                 TASKGRAPH_HEAD_REV: ${taskgraph.revision}
                                 TASKGRAPH_REPOSITORY_TYPE: hg
                                 REPOSITORIES: {$json: {admin: ci-admin, config: ci-config, taskgraph: "Taskgraph"}}
                                 HG_STORE_PATH: /builds/worker/checkouts/hg-store
                               - $if: 'tasks_for == "action"'
                                 then:
@@ -158,48 +159,53 @@ tasks:
                       # Note: This task is built server side without the context or tooling that
                       # exist in tree so we must hard code the hash
                       image:
                           mozillareleases/taskgraph:decision-21bef1bc0f11e62c7a23384584f9f8f0d96e95eef192e5bb599fc82ba55c81a7@sha256:53dcd47f72a09c12dd528812b2c4031bbb7db9455959747eb059e5e590f00487
 
                       maxRunTime: 1800
 
                       command:
-                          - /usr/local/bin/run-task
-                          - '--admin-checkout=/builds/worker/checkouts/src'
-                          - '--taskgraph-checkout=/builds/worker/checkouts/taskgraph'
-                          - '--task-cwd=/builds/worker/checkouts/src'
-                          - '--'
-                          - bash
-                          - -cx
-                          - $let:
-                                extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
-                            in:
-                                $if: 'tasks_for == "action"'
-                                then: >
-                                    cd /builds/worker/checkouts/src &&
-                                    ln -s /builds/worker/artifacts artifacts &&
-                                    taskgraph action-callback
-                                else: >
-                                    pip install --user /builds/worker/checkouts/taskgraph &&
-                                    ln -s /builds/worker/artifacts artifacts &&
-                                    ~/.local/bin/taskgraph decision
-                                    --pushlog-id='${push.pushlog_id}'
-                                    --pushdate='${push.pushdate}'
-                                    --project='${repository.project}'
-                                    --message=""
-                                    --owner='${ownerEmail}'
-                                    --level='${repository.level}'
-                                    --base-repository="${repoUrl}"
-                                    --head-repository="${repoUrl}"
-                                    --head-ref="${push.revision}"
-                                    --head-rev="${push.revision}"
-                                    --repository-type=hg
-                                    --tasks-for='${tasks_for}'
-                                    ${extraArgs}
+                          $flatten:
+                              - /usr/local/bin/run-task
+                              - '--admin-checkout=/builds/worker/checkouts/src'
+                              - '--taskgraph-checkout=/builds/worker/checkouts/taskgraph'
+                              - $if: 'repository.project[:16] == "ci-configuration"'
+                                then:
+                                    - '--config-checkout=/builds/worker/checkouts/src/config'
+                              - '--task-cwd=/builds/worker/checkouts/src'
+                              - '--'
+                              - bash
+                              - -cx
+                              - $let:
+                                    extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
+                                in:
+                                    $if: 'tasks_for == "action"'
+                                    then: >
+                                        cd /builds/worker/checkouts/src &&
+                                        ln -s /builds/worker/artifacts artifacts &&
+                                        taskgraph action-callback
+                                    else: >
+                                        pip install --user /builds/worker/checkouts/taskgraph &&
+                                        ln -s /builds/worker/artifacts artifacts &&
+                                        ~/.local/bin/taskgraph decision
+                                        --pushlog-id='${push.pushlog_id}'
+                                        --pushdate='${push.pushdate}'
+                                        --project='${repository.project}'
+                                        --message=""
+                                        --owner='${ownerEmail}'
+                                        --level='${repository.level}'
+                                        --base-repository="${repoUrl}"
+                                        --head-repository="${repoUrl}"
+                                        --head-ref="${push.revision}"
+                                        --head-rev="${push.revision}"
+                                        --repository-type=hg
+                                        --tasks-for='${tasks_for}'
+                                        $${TRY_TASK_CONFIG_FILE+--try-task-config-file="$${TRY_TASK_CONFIG_FILE}"}
+                                        ${extraArgs}
 
                       artifacts:
                           'public':
                               type: 'directory'
                               path: '/builds/worker/artifacts'
                               expires: {$fromNow: '1 year'}
 
                   extra: