Bug 1530908 - Only enable artifacts on try builds that support them. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 06 Mar 2019 17:45:32 +0000
changeset 520605 ad8315f518076b67332cf5639aede5836c0bab7a
parent 520604 61dd01ed9002ad05dd35640fdbc770e03b7f7c76
child 520606 c21559af66d690144c31865c1ebf6fd0cbef5534
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1530908
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530908 - Only enable artifacts on try builds that support them. r=dustin Currently, all tasks of kind builds are indiscriminately altered to use artifacts, but only few of them actually support that, and the others won't actually have the expected result when that happens. E.g. ASAN builds with artifacts enabled end up being non-ASAN builds. Effectively, this makes the artifact flag ignored for builds that don't support artifacts. One could argue that those builds shouldn't happen at all, but it feels a better use time of developer's time to just do the full build they asked for. E.g. if they asked for ASAN with artifacts, they still get an ASAN build, rather than an error or silently having the task not happen after the decision task. This also allows to mix artifact and non-artifact builds. Further changes down the road are also modifying the artifact builds configuration, which would actively turn those builds that don't support artifact builds red (e.g. ASAN), so something has to be done anyways. The alternative would be filter those builds out. Depends on D21312 Differential Revision: https://phabricator.services.mozilla.com/D22056
taskcluster/taskgraph/transforms/build.py
--- a/taskcluster/taskgraph/transforms/build.py
+++ b/taskcluster/taskgraph/transforms/build.py
@@ -8,16 +8,18 @@ kind.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.attributes import RELEASE_PROJECTS
 from taskgraph.util.schema import resolve_keyed_by
 from taskgraph.util.workertypes import worker_type_implementation
 
+from mozbuild.artifact_builds import JOB_CHOICES as ARTIFACT_JOBS
+
 import logging
 logger = logging.getLogger(__name__)
 
 transforms = TransformSequence()
 
 
 @transforms.add
 def set_defaults(config, jobs):
@@ -141,12 +143,13 @@ def use_artifact(config, jobs):
     if config.params['try_mode'] == 'try_task_config':
         use_artifact = config.params['try_task_config'] \
             .get('templates', {}).get('artifact', {}).get('enabled')
     elif config.params['try_mode'] == 'try_option_syntax':
         use_artifact = config.params['try_options'].get('artifact')
     else:
         use_artifact = False
     for job in jobs:
-        if config.kind == 'build' and use_artifact:
+        if config.kind == 'build' and use_artifact and \
+                job.get('index', {}).get('job-name') in ARTIFACT_JOBS:
             job['treeherder']['symbol'] += 'a'
             job['worker']['env']['USE_ARTIFACT'] = '1'
         yield job