2019-09-12 16:45:26 +00:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
|
|
|
2019-09-24 10:52:05 +00:00
|
|
|
from taskgraph.target_tasks import _target_task, filter_for_tasks_for
|
|
|
|
|
|
|
|
|
2019-09-12 16:45:26 +00:00
|
|
|
@_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."""
|
|
|
|
|
2019-09-24 10:52:05 +00:00
|
|
|
filter = filter_for_tasks_for
|
2019-10-02 09:05:56 +00:00
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter_for_tasks_for(t, parameters)]
|
|
|
|
|
|
|
|
|
|
|
|
@_target_task('release')
|
|
|
|
def target_tasks_default(full_task_graph, parameters, graph_config):
|
|
|
|
|
2020-04-09 12:33:13 +00:00
|
|
|
# TODO Use shipping-phase once we retire github-releases
|
2019-10-02 09:05:56 +00:00
|
|
|
def filter(task, parameters):
|
|
|
|
return task.attributes.get("release-type", "") == parameters["release_type"]
|
2019-09-18 09:40:14 +00:00
|
|
|
|
2019-09-24 10:52:05 +00:00
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|
2019-09-13 10:48:22 +00:00
|
|
|
|
|
|
|
|
2019-09-18 10:49:22 +00:00
|
|
|
@_target_task("nightly")
|
|
|
|
def target_tasks_nightly(full_task_graph, parameters, graph_config):
|
|
|
|
"""Select the set of tasks required for a nightly build."""
|
|
|
|
|
2020-04-14 12:04:26 +00:00
|
|
|
def filter(task, parameters):
|
|
|
|
# We don't want to ship nightly while Google Play is still behind manual review.
|
|
|
|
# See bug 1628413 for more context.
|
|
|
|
return task.attributes.get("nightly", False) and task.kind != "push-apk"
|
|
|
|
|
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|
|
|
|
|
|
|
|
|
|
|
|
@_target_task("nightly-on-google-play")
|
|
|
|
def target_tasks_nightly_on_google_play(full_task_graph, parameters, graph_config):
|
|
|
|
"""Select the set of tasks required for a nightly build that goes on Google Play."""
|
|
|
|
|
2019-09-18 10:49:22 +00:00
|
|
|
def filter(task, parameters):
|
2020-02-20 16:37:03 +00:00
|
|
|
return task.attributes.get("nightly", False)
|
2019-09-18 10:49:22 +00:00
|
|
|
|
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|
2019-09-16 09:03:42 +00:00
|
|
|
|
2020-02-19 14:35:20 +00:00
|
|
|
|
|
|
|
def _filter_fennec(fennec_type, task, parameters):
|
|
|
|
return task.attributes.get("build-type", "") == "fennec-{}".format(fennec_type)
|
|
|
|
|
2020-01-15 10:10:49 +00:00
|
|
|
|
2020-02-19 14:35:20 +00:00
|
|
|
@_target_task("fennec-beta")
|
|
|
|
def target_tasks_fennec_nightly(full_task_graph, parameters, graph_config):
|
|
|
|
"""Select the set of tasks required for a beta build signed with the fennec key."""
|
|
|
|
|
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if _filter_fennec("beta", t, parameters)]
|
2020-01-15 10:10:49 +00:00
|
|
|
|
2019-09-16 09:03:42 +00:00
|
|
|
|
2019-09-13 10:48:22 +00:00
|
|
|
@_target_task('raptor')
|
|
|
|
def target_tasks_raptor(full_task_graph, parameters, graph_config):
|
2019-10-02 09:05:56 +00:00
|
|
|
def filter(task, parameters):
|
2019-09-24 10:52:05 +00:00
|
|
|
return task.kind == 'raptor'
|
2019-09-18 09:40:14 +00:00
|
|
|
|
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|
2020-03-17 17:21:41 +00:00
|
|
|
|
2020-03-20 09:26:44 +00:00
|
|
|
|
2020-03-17 17:21:41 +00:00
|
|
|
@_target_task('browsertime')
|
|
|
|
def target_tasks_raptor(full_task_graph, parameters, graph_config):
|
|
|
|
def filter(task, parameters):
|
2020-03-19 13:58:15 +00:00
|
|
|
return task.kind in ('browsertime', 'visual-metrics')
|
2020-03-17 17:21:41 +00:00
|
|
|
|
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|
2020-03-20 09:26:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
@_target_task("bump_android_components")
|
|
|
|
def target_tasks_bump_android_components(full_task_graph, parameters, graph_config):
|
|
|
|
"""Select the set of tasks required to update android components."""
|
|
|
|
|
|
|
|
def filter(task, parameters):
|
|
|
|
return task.attributes.get("bump-type", "") == "android-components"
|
|
|
|
|
|
|
|
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|