bug 1423081 - inherit shipping-product from upstream. r=callek draft
authorAki Sasaki <asasaki@mozilla.com>
Tue, 05 Dec 2017 19:10:48 -0800
changeset 711352 297a07148924276988e5d2c26e5cafa6dfa0756a
parent 711351 f3bc17f72774922d1e9b3786dbf46f63b3a6e42b
child 711353 b885b8cbfb168efdb8a174cfeb90123daf64d333
push id93059
push userasasaki@mozilla.com
push dateWed, 13 Dec 2017 21:20:02 +0000
reviewerscallek
bugs1423081
milestone59.0a1
bug 1423081 - inherit shipping-product from upstream. r=callek MozReview-Commit-ID: 88NKe04ql1a
taskcluster/taskgraph/loader/single_dep.py
taskcluster/taskgraph/transforms/checksums_signing.py
taskcluster/taskgraph/util/attributes.py
--- a/taskcluster/taskgraph/loader/single_dep.py
+++ b/taskcluster/taskgraph/loader/single_dep.py
@@ -49,9 +49,16 @@ def loader(kind, path, config, params, l
             if config_attrs - set(task.attributes):
                 # make sure all attributes exist
                 continue
 
         job = {'dependent-task': task}
         if job_template:
             job.update(copy.deepcopy(job_template))
 
+        # copy shipping_product from upstream
+        product = task.attributes.get(
+            'shipping_product', task.task.get('shipping-product')
+        )
+        if product:
+            job.setdefault('shipping-product', product)
+
         yield job
--- a/taskcluster/taskgraph/transforms/checksums_signing.py
+++ b/taskcluster/taskgraph/transforms/checksums_signing.py
@@ -24,16 +24,18 @@ taskref_or_string = Any(
     basestring,
     {Required('task-reference'): basestring})
 
 checksums_signing_description_schema = Schema({
     Required('dependent-task'): object,
     Required('depname', default='beetmover'): basestring,
     Optional('label'): basestring,
     Optional('treeherder'): task_description_schema['treeherder'],
+    Optional('shipping-product'): task_description_schema['shipping-product'],
+    Optional('shipping-phase'): task_description_schema['shipping-phase'],
 })
 
 
 @transforms.add
 def validate(config, jobs):
     for job in jobs:
         label = job.get('dependent-task', object).__dict__.get('label', '?no-label?')
         yield validate_schema(
--- a/taskcluster/taskgraph/util/attributes.py
+++ b/taskcluster/taskgraph/util/attributes.py
@@ -21,17 +21,19 @@ RELEASE_PROJECTS = {
 }
 
 RELEASE_PROMOTION_PROJECTS = {
     'jamun',
     'maple',
     'try',
 } | RELEASE_PROJECTS
 
-_OPTIONAL_ATTRIBUTES = ('nightly', 'signed', 'l10n_chunk')
+_OPTIONAL_ATTRIBUTES = (
+    'nightly', 'signed', 'l10n_chunk', 'shipping_product', 'shipping_phase'
+)
 
 
 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