bug 1442793 - pushapk artifact_prefix r?bhearsum draft
authorAki Sasaki <asasaki@mozilla.com>
Wed, 21 Mar 2018 18:55:08 -0700
changeset 782035 7ff134f04212a5a72bfc6c1f214b84a71c1f57ec
parent 782034 c6d78d5d348cecade68c98b18c2ac9418e2f5f87
child 782036 a8a5230dbeb77ae090726c35d804785a7e3f1c98
push id106465
push userasasaki@mozilla.com
push dateSat, 14 Apr 2018 00:42:17 +0000
reviewersbhearsum
bugs1442793
milestone61.0a1
bug 1442793 - pushapk artifact_prefix r?bhearsum MozReview-Commit-ID: 8NMgi5B8Ls8
taskcluster/taskgraph/transforms/push_apk.py
--- a/taskcluster/taskgraph/transforms/push_apk.py
+++ b/taskcluster/taskgraph/transforms/push_apk.py
@@ -8,16 +8,17 @@ Transform the push-apk kind into an actu
 from __future__ import absolute_import, print_function, unicode_literals
 
 import re
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.transforms.task import task_description_schema
 from taskgraph.util.schema import optionally_keyed_by, resolve_keyed_by, Schema, validate_schema
 from taskgraph.util.scriptworker import get_push_apk_scope
+from taskgraph.util.taskcluster import get_artifact_prefix
 
 from voluptuous import Optional, Required
 
 
 transforms = TransformSequence()
 
 # Voluptuous uses marker objects as dictionary *keys*, but they are not
 # comparable, so we cast all of the keys back to regular strings
@@ -80,17 +81,19 @@ Given dependencies: {}.
 '''.format(REQUIRED_ARCHITECTURES, dependent_tasks)
         )
 
 
 @transforms.add
 def make_task_description(config, jobs):
     for job in jobs:
         job['dependencies'] = generate_dependencies(job['dependent-tasks'])
-        job['worker']['upstream-artifacts'] = generate_upstream_artifacts(job['dependencies'])
+        job['worker']['upstream-artifacts'] = generate_upstream_artifacts(
+            job, job['dependencies']
+        )
 
         # Use the rc-google-play-track and rc-rollout-percentage in RC relpro flavors
         if config.params['release_type'] == 'rc':
             job['worker']['google-play-track'] = job['worker']['rc-google-play-track']
             job['worker']['rollout-percentage'] = job['worker']['rc-rollout-percentage']
 
         resolve_keyed_by(
             job, 'worker.google-play-track', item_name=job['name'],
@@ -123,21 +126,22 @@ def generate_dependencies(dependent_task
         platform_match = PLATFORM_REGEX.match(task.label)
         # platform_match is None when the google-play-string task is given, for instance
         task_kind = task.kind if platform_match is None else \
             '{}-{}'.format(task.kind, platform_match.group(1))
         dependencies[task_kind] = task.label
     return dependencies
 
 
-def generate_upstream_artifacts(dependencies):
+def generate_upstream_artifacts(job, dependencies):
+    artifact_prefix = get_artifact_prefix(job)
     apks = [{
         'taskId': {'task-reference': '<{}>'.format(task_kind)},
         'taskType': 'signing',
-        'paths': ['public/build/target.apk'],
+        'paths': ['{}/target.apk'.format(artifact_prefix)],
     } for task_kind in dependencies.keys()
       if task_kind not in ('google-play-strings', 'beetmover-checksums')
     ]
 
     google_play_strings = [{
         'taskId': {'task-reference': '<{}>'.format(task_kind)},
         'taskType': 'build',
         'paths': ['public/google_play_strings.json'],