Bug 1356700 - Set MOZ_AUTOMATION on all taskcluster jobs. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 15 Apr 2017 07:30:42 +0900
changeset 563822 8f9cfd4db483069e5fa0a2fdd7b20373ddf76877
parent 563335 ce69b6e1773e9e0d0a190ce899f34b1658e66ca4
child 563823 057bb074a9cc1388311c2d91a9ae8169ebc737ea
push id54432
push userbmo:mh+mozilla@glandium.org
push dateMon, 17 Apr 2017 21:50:48 +0000
reviewersdustin
bugs1356700
milestone55.0a1
Bug 1356700 - Set MOZ_AUTOMATION on all taskcluster jobs. r?dustin
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -950,16 +950,28 @@ def build_task(config, tasks):
                 th_push_link)
 
         # add the payload and adjust anything else as required (e.g., scopes)
         payload_builders[task['worker']['implementation']](config, task, task_def)
 
         attributes = task.get('attributes', {})
         attributes['run_on_projects'] = task.get('run-on-projects', ['all'])
 
+        # Set MOZ_AUTOMATION on all jobs.
+        if task['worker']['implementation'] in (
+            'generic-worker',
+            'docker-engine',
+            'native-engine',
+            'docker-worker',
+        ):
+            payload = task_def.get('payload')
+            if payload:
+                env = payload.setdefault('env', {})
+                env['MOZ_AUTOMATION'] = '1'
+
         yield {
             'label': task['label'],
             'task': task_def,
             'dependencies': task.get('dependencies', {}),
             'attributes': attributes,
             'optimizations': task.get('optimizations', []),
         }