Bug 1442545: [partner-repack] Don't display partner repacks on treeherder; r=Callek, a=release
authorTom Prince <mozilla@hocat.ca>
Wed, 18 Apr 2018 13:07:07 -0600
changeset 463419 bf9420bfbd0a7b7043652f833e87fd18399e279f
parent 463418 5ee837cbe55c00871123042552a36dd2b6138186
child 463420 3b9072ca98e5c623259d7dc8c2c42d2ed3b0399b
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek, release
bugs1442545
milestone60.0
Bug 1442545: [partner-repack] Don't display partner repacks on treeherder; r=Callek, a=release Differential Revision: https://phabricator.services.mozilla.com/D978
taskcluster/taskgraph/transforms/signing.py
--- a/taskcluster/taskgraph/transforms/signing.py
+++ b/taskcluster/taskgraph/transforms/signing.py
@@ -100,30 +100,32 @@ def make_task_description(config, jobs):
         for artifacts in job['upstream-artifacts']:
             for f in artifacts['formats']:
                 formats.add(f)  # Add each format only once
         for format in formats:
             signing_format_scopes.append(
                 add_scope_prefix(config, 'signing:format:{}'.format(format))
             )
 
-        treeherder = job.get('treeherder', {})
         is_nightly = dep_job.attributes.get('nightly', False)
-        treeherder.setdefault('symbol', _generate_treeherder_symbol(is_nightly))
+        treeherder = None
+        if 'partner' not in config.kind:
+            treeherder = job.get('treeherder', {})
+            treeherder.setdefault('symbol', _generate_treeherder_symbol(is_nightly, config.kind))
 
-        dep_th_platform = dep_job.task.get('extra', {}).get(
-            'treeherder', {}).get('machine', {}).get('platform', '')
-        build_type = dep_job.attributes.get('build_type')
-        build_platform = dep_job.attributes.get('build_platform')
-        treeherder.setdefault('platform', _generate_treeherder_platform(
-            dep_th_platform, build_platform, build_type
-        ))
+            dep_th_platform = dep_job.task.get('extra', {}).get(
+                'treeherder', {}).get('machine', {}).get('platform', '')
+            build_type = dep_job.attributes.get('build_type')
+            build_platform = dep_job.attributes.get('build_platform')
+            treeherder.setdefault('platform', _generate_treeherder_platform(
+                dep_th_platform, build_platform, build_type
+            ))
 
-        treeherder.setdefault('tier', 1 if '-ccov' not in build_platform else 2)
-        treeherder.setdefault('kind', 'build')
+            treeherder.setdefault('tier', 1 if '-ccov' not in build_platform else 2)
+            treeherder.setdefault('kind', 'build')
 
         label = job['label']
         description = (
             "Initial Signing for locale '{locale}' for build '"
             "{build_platform}/{build_type}'".format(
                 locale=attributes.get('locale', 'en-US'),
                 build_platform=attributes.get('build_platform'),
                 build_type=attributes.get('build_type')
@@ -148,29 +150,33 @@ def make_task_description(config, jobs):
             'worker': {'implementation': 'scriptworker-signing',
                        'upstream-artifacts': job['upstream-artifacts'],
                        'max-run-time': job.get('max-run-time', 3600)},
             'scopes': [signing_cert_scope] + signing_format_scopes,
             'dependencies': {job['depname']: dep_job.label},
             'attributes': attributes,
             'run-on-projects': dep_job.attributes.get('run_on_projects'),
             'optimization': dep_job.optimization,
-            'treeherder': treeherder,
             'routes': job.get('routes', []),
             'shipping-product': job.get('shipping-product'),
             'shipping-phase': job.get('shipping-phase'),
         }
+        if treeherder:
+            task['treeherder'] = treeherder
 
         yield task
 
 
 def _generate_treeherder_platform(dep_th_platform, build_platform, build_type):
     if '-pgo' in build_platform:
         actual_build_type = 'pgo'
     elif '-ccov' in build_platform:
         actual_build_type = 'ccov'
     else:
         actual_build_type = build_type
     return '{}/{}'.format(dep_th_platform, actual_build_type)
 
 
-def _generate_treeherder_symbol(is_nightly):
-    return 'Ns' if is_nightly else 'Bs'
+def _generate_treeherder_symbol(is_nightly, kind):
+    if is_nightly:
+        return 'Ns'
+    else:
+        return 'Bs'