Bug 1636271 - [taskgraph] Set autoland optimizations via per-project parameter, r=tomprince

This creates a new set of optimization strategies
(taskgraph.optimize:project.autoland) to use with autoland. Among other things,
it also means there's no need for the 'test-try' optimization as the autoland
strategies are no longer the default behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D79705
This commit is contained in:
Andrew Halberstadt 2020-07-22 17:09:02 +00:00
Родитель 8d40cc05d4
Коммит 268c833ffc
4 изменённых файлов: 25 добавлений и 15 удалений

Просмотреть файл

@ -72,6 +72,10 @@ PER_PROJECT_PARAMETERS = {
'target_tasks_method': 'graphics_tasks',
},
'autoland': {
'optimize_strategies': 'taskgraph.optimize:project.autoland',
},
'mozilla-central': {
'target_tasks_method': 'default',
'release_type': 'nightly',

Просмотреть файл

@ -397,11 +397,12 @@ class Alias(CompositeStrategy):
def split_bugbug_arg(arg):
"""
The bugbug optimization strageies require passing an dict as
scratch space for communicating with downstream stratgies.
This function pass the provided argument to the first strategy,
and a fresh dictionary to the second stratgey.
"""Split args for bugbug based strategies.
Many bugbug based optimizations require passing an empty dict by reference
to communicate to downstream strategies. This function passes the provided
arg to the first strategy and an empty dict to second (bugbug based)
strategy.
"""
return (arg, {})
@ -417,15 +418,24 @@ register_strategy('build-optimized', args=(
'backstop',
))(All)
register_strategy('build-fuzzing', args=('push-interval-10',))(Alias)
register_strategy('test', args=(
Any('skip-unless-schedules', 'bugbug-reduced-fallback', split_args=split_bugbug_arg),
'backstop',
))(All)
register_strategy('test', args=('skip-unless-schedules',))(Alias)
register_strategy('test-inclusive', args=('skip-unless-schedules',))(Alias)
register_strategy('test-try', args=('skip-unless-schedules',))(Alias)
# Strategy overrides used by |mach try| and/or shadow-scheduler tasks.
# Strategy overrides used to tweak the default strategies. These are referenced
# by the `optimize_strategies` parameter.
class project(object):
"""Strategies that should be applied per-project."""
autoland = {
'test': All(
Any('skip-unless-schedules', 'bugbug-reduced-fallback', split_args=split_bugbug_arg),
'backstop',
),
}
"""Strategy overrides that apply to autoland."""
class experimental(object):
"""Experimental strategies either under development or used as benchmarks.

Просмотреть файл

@ -1817,9 +1817,6 @@ def make_job_description(config, tasks):
jobdesc['when'] = task['when']
elif 'optimization' in task:
jobdesc['optimization'] = task['optimization']
# Pushes generated by `mach try auto` should use the non-try optimizations.
elif config.params.is_try() and config.params['try_mode'] != 'try_auto':
jobdesc['optimization'] = {'test-try': schedules}
elif set(schedules) & set(INCLUSIVE_COMPONENTS):
jobdesc['optimization'] = {'test-inclusive': schedules}
else:

Просмотреть файл

@ -225,7 +225,6 @@ OptimizationSchema = voluptuous.Any(
# optimize strategy aliases for the test kind
{'test': list(schedules.ALL_COMPONENTS)},
{'test-inclusive': list(schedules.ALL_COMPONENTS)},
{'test-try': list(schedules.ALL_COMPONENTS)},
)
# shortcut for a string where task references are allowed