Bug 1501759: [taskgraph] Simplify release branch on-push target tasks; r=aki
authorTom Prince <mozilla@hocat.ca>
Wed, 24 Oct 2018 20:43:58 +0000
changeset 491216 ff0a31d4ba06c0368009b701dbc9acfa67989690
parent 491215 4a209d2b46acc350cc061751172ffd0ed3174836
child 491217 6586f2d7f3cb9db56b111081cf985f801d6055c0
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersaki
bugs1501759
milestone65.0a1
Bug 1501759: [taskgraph] Simplify release branch on-push target tasks; r=aki Differential Revision: https://phabricator.services.mozilla.com/D9688
taskcluster/taskgraph/target_tasks.py
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -42,28 +42,20 @@ def filter_for_project(task, parameters)
 
 
 def filter_on_platforms(task, platforms):
     """Filter tasks on the given platform"""
     platform = task.attributes.get('build_platform')
     return (platform in platforms)
 
 
-def filter_beta_release_tasks(task, parameters, ignore_kinds=None, allow_l10n=False):
+def filter_release_tasks(task, parameters):
     if not standard_filter(task, parameters):
         return False
-    if ignore_kinds is None:
-        ignore_kinds = [
-            'balrog',
-            'beetmover', 'beetmover-checksums', 'beetmover-l10n',
-            'beetmover-repackage', 'beetmover-repackage-signing',
-            'checksums-signing',
-            'nightly-l10n', 'nightly-l10n-signing',
-            'push-apk', 'repackage-l10n',
-        ]
+
     platform = task.attributes.get('build_platform')
     if platform in (
             # On beta, Nightly builds are already PGOs
             'linux-pgo', 'linux64-pgo',
             'win32-pgo', 'win64-pgo',
             # ASAN is central-only
             'linux64-asan-reporter-nightly',
             'win64-asan-reporter-nightly',
@@ -78,23 +70,17 @@ def filter_beta_release_tasks(task, para
         if task.attributes['kind'] == 'l10n':
             # This is on-change l10n
             return True
         if task.attributes['build_type'] == 'opt' and \
            task.attributes.get('unittest_suite') != 'talos' and \
            task.attributes.get('unittest_suite') != 'raptor':
             return False
 
-    # skip l10n, beetmover, balrog
-    if task.kind in ignore_kinds:
-        return False
-
-    # No l10n repacks per push. They may be triggered by kinds which depend
-    # on l10n builds/repacks. For instance: "repackage-signing"
-    if not allow_l10n and task.attributes.get('locale', '') != '':
+    if task.attributes.get('shipping_phase') not in (None, 'build'):
         return False
 
     return True
 
 
 def standard_filter(task, parameters):
     return all(
         filter_func(task, parameters) for filter_func in
@@ -174,17 +160,17 @@ def target_tasks_try(full_task_graph, pa
 
 
 @_target_task('default')
 def target_tasks_default(full_task_graph, parameters, graph_config):
     """Target the tasks which have indicated they should be run on this project
     via the `run_on_projects` attributes."""
     return [l for l, t in full_task_graph.tasks.iteritems()
             if standard_filter(t, parameters)
-            or filter_out_nightly(t, parameters)]
+            and filter_out_nightly(t, parameters)]
 
 
 @_target_task('ash_tasks')
 def target_tasks_ash(full_task_graph, parameters, graph_config):
     """Target tasks that only run on the ash branch."""
     def filter(task):
         platform = task.attributes.get('build_platform')
         # Early return if platform is None
@@ -269,38 +255,38 @@ def target_tasks_valgrind(full_task_grap
 
 
 @_target_task('mozilla_beta_tasks')
 def target_tasks_mozilla_beta(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a promotable beta or release build
     of desktop, plus android CI. The candidates build process involves a pipeline
     of builds and signing, but does not include beetmover or balrog jobs."""
 
-    return [l for l, t in full_task_graph.tasks.iteritems() if
-            filter_beta_release_tasks(t, parameters)]
+    return [l for l, t in full_task_graph.tasks.iteritems()
+            if filter_release_tasks(t, parameters)]
 
 
 @_target_task('mozilla_release_tasks')
 def target_tasks_mozilla_release(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a promotable beta or release build
     of desktop, plus android CI. The candidates build process involves a pipeline
     of builds and signing, but does not include beetmover or balrog jobs."""
 
-    return [l for l, t in full_task_graph.tasks.iteritems() if
-            filter_beta_release_tasks(t, parameters)]
+    return [l for l, t in full_task_graph.tasks.iteritems()
+            if filter_release_tasks(t, parameters)]
 
 
 @_target_task('mozilla_esr60_tasks')
 def target_tasks_mozilla_esr60(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a promotable beta or release build
     of desktop, plus android CI. The candidates build process involves a pipeline
     of builds and signing, but does not include beetmover or balrog jobs."""
 
     def filter(task):
-        if not filter_beta_release_tasks(task, parameters):
+        if not filter_release_tasks(task, parameters):
             return False
 
         platform = task.attributes.get('build_platform')
 
         # Android is not built on esr.
         if platform and 'android' in platform:
             return False