Bug 1340564: filter for android tasks using the build_platform attribute; r=jlorenzo
authorDustin J. Mitchell <dustin@mozilla.com>
Tue, 25 Apr 2017 21:59:42 +0000
changeset 358085 44a0f9f0dff4d9d3d1d19bac326e7a9e6070216a
parent 358084 b1e27dba755b4ca2c26565f0b2849a3c3b1bd7fa
child 358086 41b461000ca6c82b1a247169fbe0e81fa6a3ec2c
push id31812
push userryanvm@gmail.com
push dateFri, 12 May 2017 15:49:02 +0000
treeherdermozilla-central@1e2fe13035e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlorenzo
bugs1340564
milestone55.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
Bug 1340564: filter for android tasks using the build_platform attribute; r=jlorenzo This avoids using substring matching on labels, which is likely to lead to sadness someday. MozReview-Commit-ID: J1pFuP1U335
taskcluster/taskgraph/loader/push_apk.py
taskcluster/taskgraph/util/push_apk.py
--- a/taskcluster/taskgraph/loader/push_apk.py
+++ b/taskcluster/taskgraph/loader/push_apk.py
@@ -21,12 +21,13 @@ def loader(kind, path, config, params, l
 def get_dependent_loaded_tasks(config, loaded_tasks):
     nightly_tasks = (
         task for task in loaded_tasks if task.attributes.get('nightly')
     )
     tasks_with_matching_kind = (
         task for task in nightly_tasks if task.kind in config.get('kind-dependencies')
     )
     android_tasks = [
-        task for task in tasks_with_matching_kind if 'android' in task.label
+        task for task in tasks_with_matching_kind
+        if task.attributes.get('build_platform', '').startswith('android')
     ]
 
     return android_tasks
--- a/taskcluster/taskgraph/util/push_apk.py
+++ b/taskcluster/taskgraph/util/push_apk.py
@@ -4,17 +4,20 @@
 """
 Common functions for both push-apk and push-apk-breakpoint.
 """
 
 import re
 
 from taskgraph.util.schema import validate_schema
 
-REQUIRED_ARCHITECTURES = ('android-x86', 'android-api-15')
+REQUIRED_ARCHITECTURES = {
+    'android-x86-nightly',
+    'android-api-15-nightly',
+}
 PLATFORM_REGEX = re.compile(r'signing-android-(\S+)-nightly')
 
 
 def fill_labels_tranform(_, jobs):
     for job in jobs:
         job['label'] = job['name']
 
         yield job
@@ -31,25 +34,19 @@ def validate_jobs_schema_transform_parti
 
 def validate_dependent_tasks_transform(_, jobs):
     for job in jobs:
         check_every_architecture_is_present_in_dependent_tasks(job['dependent-tasks'])
         yield job
 
 
 def check_every_architecture_is_present_in_dependent_tasks(dependent_tasks):
-    dependencies_labels = [task.label for task in dependent_tasks]
-
-    is_this_required_architecture_present = {
-        architecture: any(architecture in label for label in dependencies_labels)
-        for architecture in REQUIRED_ARCHITECTURES
-    }
-    are_all_required_achitectures_present = all(is_this_required_architecture_present.values())
-
-    if not are_all_required_achitectures_present:
+    dep_platforms = set(t.attributes.get('build_platform') for t in dependent_tasks)
+    missed_architectures = REQUIRED_ARCHITECTURES - dep_platforms
+    if missed_architectures:
         raise Exception('''One or many required architectures are missing.
 
 Required architectures: {}.
 Given dependencies: {}.
 '''.format(REQUIRED_ARCHITECTURES, dependent_tasks)
         )