No bug: [taskgraph] Simplify upload_symbols logic; r=mtabara
authorTom Prince <mozilla@hocat.ca>
Fri, 13 Dec 2019 08:03:31 +0000
changeset 506927 311d5c5f82d561e4e64423b64caa7653fe771a99
parent 506926 916dc46f525162fc9a7c78208e1fd60a057f1a8c
child 506928 6bb1f32fbae94bfb7f7fc3fcfc08c95d08035d0a
push id36915
push userrgurzau@mozilla.com
push dateFri, 13 Dec 2019 21:43:22 +0000
treeherdermozilla-central@f09f24f2b545 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtabara
milestone73.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
No bug: [taskgraph] Simplify upload_symbols logic; r=mtabara Differential Revision: https://phabricator.services.mozilla.com/D57081
taskcluster/taskgraph/transforms/upload_symbols.py
--- a/taskcluster/taskgraph/transforms/upload_symbols.py
+++ b/taskcluster/taskgraph/transforms/upload_symbols.py
@@ -5,17 +5,18 @@
 Transform the upload-symbols task description template,
 taskcluster/ci/upload-symbols/job-template.yml into an actual task description.
 """
 
 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.treeherder import join_symbol
+from taskgraph.util.treeherder import join_symbol, inherit_treeherder_from_dep
+from taskgraph.util.attributes import copy_attributes_from_dependent_job
 
 import logging
 logger = logging.getLogger(__name__)
 
 transforms = TransformSequence()
 
 
 @transforms.add
@@ -49,47 +50,36 @@ def fill_template(config, tasks):
             continue
 
         task['dependencies'] = {'build': dep.label}
         task['worker']['env']['GECKO_HEAD_REPOSITORY'] = config.params['head_repository']
         task['worker']['env']['GECKO_HEAD_REV'] = config.params['head_rev']
         task['worker']['env']['SYMBOL_SECRET'] = task['worker']['env']['SYMBOL_SECRET'].format(
             level=config.params['level'])
 
-        build_platform = dep.attributes.get('build_platform')
-        build_type = dep.attributes.get('build_type')
-        attributes = task.setdefault('attributes', {})
-        attributes['build_platform'] = build_platform
-        attributes['build_type'] = build_type
-        if dep.attributes.get('nightly'):
-            attributes['nightly'] = True
-        if dep.attributes.get('shippable'):
-            attributes['shippable'] = True
+        attributes = copy_attributes_from_dependent_job(dep)
+        attributes.update(task.get('attributes', {}))
+        task['attributes'] = attributes
 
-        treeherder = task.get('treeherder', {})
+        treeherder = inherit_treeherder_from_dep(task, dep)
         th = dep.task.get('extra')['treeherder']
-        th_platform = dep.task['extra'].get('treeherder-platform',
-                                            "{}/{}".format(th['machine']['platform'], build_type))
         th_symbol = th.get('symbol')
         th_groupsymbol = th.get('groupSymbol', '?')
-        treeherder.setdefault('platform', th_platform)
-        treeherder.setdefault('tier', th['tier'])
-        treeherder.setdefault('kind', th['jobKind'])
 
         # Disambiguate the treeherder symbol.
         sym = 'Sym' + (th_symbol[1:] if th_symbol.startswith('B') else th_symbol)
         treeherder.setdefault(
             'symbol', join_symbol(th_groupsymbol, sym)
         )
         task['treeherder'] = treeherder
 
-        if dep.attributes.get('nightly'):
+        if attributes.get('nightly'):
             # For nightly builds, we want to run these tasks if the build is run.
             task['run-on-projects'] = dep.attributes.get('run_on_projects')
-        elif dep.attributes.get('shippable'):
+        elif attributes.get('shippable'):
             # For shippable builds, we want to run these tasks if the build is run.
             # XXX Better to run this on promote phase instead?
             task['run-on-projects'] = dep.attributes.get('run_on_projects')
         else:
             # For other builds, these can be requested to upload to the try symbol sever.
             task['run-on-projects'] = ['try']
 
         # clear out the stuff that's not part of a task description