Bug 1368733 - [taskcluster] Ensure job tasks run automatically on try when they're supposed to, r=dustin
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 30 May 2017 12:37:03 -0400
changeset 361352 b487d2321fe4165f0b096ff09803bcf4e5f73299
parent 361351 9baa6614a0bacb00fce0810203a25a67c0357294
child 361353 b71563f2795878de5a203333a115e87622dce39b
push id43729
push userahalberstadt@mozilla.com
push dateTue, 30 May 2017 18:43:20 +0000
treeherderautoland@b487d2321fe4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1368733
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 1368733 - [taskcluster] Ensure job tasks run automatically on try when they're supposed to, r=dustin The logic here is a bit tricky to grok, but essentially there are two kinds of "job" tasks, those that should always be considered (and possibly be optimized away later due to "skip-unless-changed"), and those that should only be considered if their associated build-platform is also going to be scheduled. If -j is specified, that should supercede both cases. This patch uses the prescence of the 'build_platform' attribute to draw the distinction. MozReview-Commit-ID: H9SjeYuZ8F0
taskcluster/taskgraph/transforms/source_test.py
taskcluster/taskgraph/try_option_syntax.py
--- a/taskcluster/taskgraph/transforms/source_test.py
+++ b/taskcluster/taskgraph/transforms/source_test.py
@@ -98,17 +98,10 @@ def handle_platform(config, jobs):
         platform = job['platform']
 
         for field in fields:
             resolve_keyed_by(job, field, item_name=job['name'])
 
         if 'treeherder' in job:
             job['treeherder']['platform'] = platform
 
-        build_platform, build_type = platform.split('/')
-
-        job['attributes'].update({
-            'build_platform': build_platform,
-            'build_type': build_type,
-        })
-
         del job['platform']
         yield job
--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -581,19 +581,26 @@ class TryOptionSyntax(object):
                 if platform not in test['platforms']:
                     return False
             if 'only_chunks' in test and attr('test_chunk') not in test['only_chunks']:
                 return False
             return True
 
         job_try_name = attr('job_try_name')
         if job_try_name:
-            if self.jobs is None or job_try_name in self.jobs:
+            # Beware the subtle distinction between [] and None for self.jobs and self.platforms.
+            # They will be [] if there was no try syntax, and None if try syntax was detected but
+            # they remained unspecified.
+            if self.jobs and job_try_name not in self.jobs:
+                return False
+            elif not self.jobs and attr('build_platform'):
                 if self.platforms is None or attr('build_platform') in self.platforms:
                     return True
+                return False
+            return True
         elif attr('kind') == 'test':
             return match_test(self.unittests, 'unittest_try_name') \
                  or match_test(self.talos, 'talos_try_name')
         elif attr('kind') in BUILD_KINDS:
             if attr('build_type') not in self.build_types:
                 return False
             elif self.platforms is None:
                 # for "-p all", look for try in the 'run_on_projects' attribute