From 8f45b2b0d40c28a546ad69920437e450070c7a1d Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 2 Sep 2020 20:20:26 +0000 Subject: [PATCH] Bug 1650406 - [taskgraph] Never run 'upload-symbols' tasks with |mach try auto|, r=marco Differential Revision: https://phabricator.services.mozilla.com/D88874 --- taskcluster/taskgraph/optimize/__init__.py | 2 ++ taskcluster/taskgraph/transforms/upload_symbols.py | 1 + taskcluster/taskgraph/util/schema.py | 5 +++++ taskcluster/test/test_mach_try_auto.py | 6 +----- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/taskcluster/taskgraph/optimize/__init__.py b/taskcluster/taskgraph/optimize/__init__.py index 486557ee7584..eb99e1e78842 100644 --- a/taskcluster/taskgraph/optimize/__init__.py +++ b/taskcluster/taskgraph/optimize/__init__.py @@ -494,6 +494,7 @@ register_strategy('build-fuzzing', args=('push-interval-10', 'backstop'))(All) register_strategy('test', args=('skip-unless-schedules',))(Alias) register_strategy('test-inclusive', args=('skip-unless-schedules',))(Alias) register_strategy('test-verify', args=('skip-unless-schedules',))(Alias) +register_strategy('upload-symbols', args=('never',))(Alias) # Strategy overrides used to tweak the default strategies. These are referenced @@ -673,4 +674,5 @@ tryselect = ExperimentalOverride(experimental, { 'build': Any('skip-unless-schedules', 'bugbug-reduced', split_args=split_bugbug_arg), 'build-fuzzing': Alias('bugbug-reduced'), 'test-verify': 'base:test', + 'upload-symbols': Alias('always'), }) diff --git a/taskcluster/taskgraph/transforms/upload_symbols.py b/taskcluster/taskgraph/transforms/upload_symbols.py index 4c1f60fd9a10..735701dbac94 100644 --- a/taskcluster/taskgraph/transforms/upload_symbols.py +++ b/taskcluster/taskgraph/transforms/upload_symbols.py @@ -75,6 +75,7 @@ def fill_template(config, tasks): # We only want to run these tasks if the build is run. # XXX Better to run this on promote phase instead? task['run-on-projects'] = dep.attributes.get('run_on_projects') + task['optimization'] = {'upload-symbols': None} task['if-dependencies'] = ['build'] # clear out the stuff that's not part of a task description diff --git a/taskcluster/taskgraph/util/schema.py b/taskcluster/taskgraph/util/schema.py index fd64e405f771..68038fde0896 100644 --- a/taskcluster/taskgraph/util/schema.py +++ b/taskcluster/taskgraph/util/schema.py @@ -226,6 +226,9 @@ OptimizationSchema = voluptuous.Any( # search the index for the given index namespaces, and replace this task if found # the search occurs in order, with the first match winning {'index-search': [text_type]}, + # never optimize this task + {'never': None}, + # skip the task except for every Nth push {'push-interval-10': None}, {'push-interval-20': None}, # skip this task if none of the given file patterns match @@ -237,6 +240,8 @@ OptimizationSchema = voluptuous.Any( {'test-inclusive': list(schedules.ALL_COMPONENTS)}, # optimize strategy alias for test-verify tasks {'test-verify': list(schedules.ALL_COMPONENTS)}, + # optimize strategy alias for upload-symbols tasks + {'upload-symbols': None}, ) # shortcut for a string where task references are allowed diff --git a/taskcluster/test/test_mach_try_auto.py b/taskcluster/test/test_mach_try_auto.py index d64291ce66a2..7abef47e3aab 100644 --- a/taskcluster/test/test_mach_try_auto.py +++ b/taskcluster/test/test_mach_try_auto.py @@ -71,11 +71,7 @@ def test_only_important_manifests(params, full_task_graph, filter_tasks): id="no build-signing", marks=pytest.mark.xfail, ), - pytest.param( - lambda t: t.kind == "upload-symbols", - id="no upload-symbols", - marks=pytest.mark.xfail, - ), + pytest.param(lambda t: t.kind == "upload-symbols", id="no upload-symbols",), ), ) def test_tasks_are_not_scheduled(optimized_task_graph, filter_tasks, func):