Bug 1386332 - Clarify nightly l10n signing tasks. r=dustin draft
authorJustin Wood <Callek@gmail.com>
Tue, 01 Aug 2017 13:03:15 -0400
changeset 620719 aa9325ac3c4004cb0781a662cb0e977796ba9f87
parent 620718 bff1c372fb8508b728f599d86f2057012264af4a
child 640789 e67bdf2abdf01396fc221fd58918ab1420aefcf7
push id72134
push userCallek@gmail.com
push dateThu, 03 Aug 2017 20:25:25 +0000
reviewersdustin
bugs1386332
milestone57.0a1
Bug 1386332 - Clarify nightly l10n signing tasks. r=dustin MozReview-Commit-ID: LcdSb5kKUAC
taskcluster/ci/nightly-l10n-signing/kind.yml
taskcluster/taskgraph/transforms/name_sanity.py
taskcluster/taskgraph/transforms/nightly_l10n_signing.py
taskcluster/taskgraph/util/attributes.py
--- a/taskcluster/ci/nightly-l10n-signing/kind.yml
+++ b/taskcluster/ci/nightly-l10n-signing/kind.yml
@@ -1,15 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
+   - taskgraph.transforms.name_sanity:transforms
    - taskgraph.transforms.nightly_l10n_signing:transforms
    - taskgraph.transforms.signing:transforms
    - taskgraph.transforms.task:transforms
 
 kind-dependencies:
   - nightly-l10n
 
 only-for-attributes:
--- a/taskcluster/taskgraph/transforms/name_sanity.py
+++ b/taskcluster/taskgraph/transforms/name_sanity.py
@@ -16,20 +16,24 @@ transforms = TransformSequence()
 
 @transforms.add
 def make_label(config, jobs):
     """ Generate a sane label for a new task constructed from a dependency
     Using attributes from the dependent job and the current task kind"""
     for job in jobs:
         dep_job = job['dependent-task']
         attr = dep_job.attributes.get
+
         if attr('locale', job.get('locale')):
             template = "{kind}-{locale}-{build_platform}/{build_type}"
+        elif attr('l10n_chunk'):
+            template = "{kind}-{build_platform}-{l10n_chunk}/{build_type}"
         else:
             template = "{kind}-{build_platform}/{build_type}"
         job['label'] = template.format(
             kind=config.kind,
             build_platform=attr('build_platform'),
             build_type=attr('build_type'),
             locale=attr('locale', job.get('locale', '')),  # Locale can be absent
+            l10n_chunk=attr('l10n_chunk', '')  # Can be empty
         )
 
         yield job
--- a/taskcluster/taskgraph/transforms/nightly_l10n_signing.py
+++ b/taskcluster/taskgraph/transforms/nightly_l10n_signing.py
@@ -81,19 +81,16 @@ def make_signing_description(config, job
                 "paths": [f.format(locale=l)
                           for l in dep_job.attributes.get('chunk_locales', [])
                           for f in spec['artifacts']],
                 "formats": [fmt]
             })
 
         job['upstream-artifacts'] = upstream_artifacts
 
-        label = dep_job.label.replace("nightly-l10n-", "signing-l10n-")
-        job['label'] = label
-
         # add the chunk number to the TH symbol
         symbol = 'Ns{}'.format(dep_job.attributes.get('l10n_chunk'))
         group = 'tc-L10n'
 
         job['treeherder'] = {
             'symbol': join_symbol(group, symbol),
         }
 
--- a/taskcluster/taskgraph/util/attributes.py
+++ b/taskcluster/taskgraph/util/attributes.py
@@ -14,17 +14,17 @@ TRUNK_PROJECTS = INTEGRATION_PROJECTS | 
 
 RELEASE_PROJECTS = {
     'mozilla-central',
     'mozilla-aurora',
     'mozilla-beta',
     'mozilla-release',
 }
 
-_OPTIONAL_ATTRIBUTES = ('nightly', 'signed')
+_OPTIONAL_ATTRIBUTES = ('nightly', 'signed', 'l10n_chunk')
 
 
 def attrmatch(attributes, **kwargs):
     """Determine whether the given set of task attributes matches.  The
     conditions are given as keyword arguments, where each keyword names an
     attribute.  The keyword value can be a literal, a set, or a callable.  A
     literal must match the attribute exactly.  Given a set, the attribute value
     must be in the set.  A callable is called with the attribute value.  If an