зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1656465 - Drop the 'remove_on_projects' feature from the Backstop optimization, r=marco
In the past, the 'backstop' optimization was applied to tasks by default across all projects, even though it only really made sense on autoland. To choose what would happen on non-autoland branches, we invented this 'remove_on_projects' concept. These days, we only apply the backstop optimization in the first place for autoland. So 'remove_on_projects' is no longer necessary. Depends on D88149 Differential Revision: https://phabricator.services.mozilla.com/D88150
This commit is contained in:
Родитель
455f1d3e89
Коммит
0845c6922f
|
@ -5,7 +5,6 @@
|
|||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
from taskgraph.optimize import All, OptimizationStrategy, register_strategy
|
||||
from taskgraph.util.attributes import match_run_on_projects
|
||||
from taskgraph.util.backstop import BACKSTOP_PUSH_INTERVAL
|
||||
|
||||
|
||||
|
@ -21,26 +20,15 @@ class SkipUnlessPushInterval(OptimizationStrategy):
|
|||
|
||||
Args:
|
||||
push_interval (int): Number of pushes
|
||||
remove_on_projects (set): For non-autoland projects, the task will
|
||||
be removed if we're running on one of these projects, otherwise
|
||||
it will be kept.
|
||||
"""
|
||||
def __init__(self, push_interval, remove_on_projects=None):
|
||||
self.push_interval = push_interval
|
||||
self.remove_on_projects = remove_on_projects or {'try'}
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
return "skip-unless-push-interval-{}".format(self.push_interval)
|
||||
|
||||
def should_remove_task(self, task, params, _):
|
||||
project = params["project"]
|
||||
|
||||
# Scheduling on a backstop only makes sense on autoland. For other projects,
|
||||
# remove the task if the project matches self.remove_on_projects.
|
||||
if project != 'autoland':
|
||||
return match_run_on_projects(project, self.remove_on_projects)
|
||||
|
||||
# On every Nth push, want to run all tasks.
|
||||
return int(params["pushlog_id"]) % self.push_interval != 0
|
||||
|
||||
|
|
|
@ -338,15 +338,6 @@ def test_push_interval(params):
|
|||
scheduled = {t.label for t in default_tasks if not opt.should_remove_task(t, params, None)}
|
||||
assert scheduled == all_labels
|
||||
|
||||
# On non-autoland projects the 'remove_on_projects' value is used.
|
||||
params['project'] = 'mozilla-central'
|
||||
scheduled = {t.label for t in default_tasks if not opt.should_remove_task(t, params, None)}
|
||||
assert scheduled == all_labels
|
||||
|
||||
params['project'] = 'try'
|
||||
scheduled = {t.label for t in default_tasks if not opt.should_remove_task(t, params, None)}
|
||||
assert scheduled == set()
|
||||
|
||||
|
||||
def test_expanded(params):
|
||||
all_labels = {t.label for t in default_tasks}
|
||||
|
|
Загрузка…
Ссылка в новой задаче