Bug 1857841 - pt 3. Add a new page kind named "fresh" r=glandium
[gecko.git] / taskcluster / gecko_taskgraph / target_tasks.py
blob67f97f92738e573635c08fe2e0bd2193590407c6
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 import itertools
7 import logging
8 import os
9 import re
10 from datetime import datetime, timedelta
12 from redo import retry
13 from taskgraph.parameters import Parameters
14 from taskgraph.target_tasks import _target_task, get_method
15 from taskgraph.util.taskcluster import find_task_id
17 from gecko_taskgraph import GECKO, try_option_syntax
18 from gecko_taskgraph.util.attributes import (
19 match_run_on_hg_branches,
20 match_run_on_projects,
22 from gecko_taskgraph.util.hg import find_hg_revision_push_info, get_hg_commit_message
23 from gecko_taskgraph.util.platforms import platform_family
25 logger = logging.getLogger(__name__)
28 # Some tasks show up in the target task set, but are possibly special cases,
29 # uncommon tasks, or tasks running against limited hardware set that they
30 # should only be selectable with --full.
31 UNCOMMON_TRY_TASK_LABELS = [
32 # Platforms and/or Build types
33 r"build-.*-gcp", # Bug 1631990
34 r"mingwclang", # Bug 1631990
35 r"valgrind", # Bug 1631990
36 # Android tasks
37 r"android-geckoview-docs",
38 r"android-hw",
39 # Windows tasks
40 r"windows10-64-ref-hw",
41 r"windows10-aarch64-qr",
42 # Linux tasks
43 r"linux-", # hide all linux32 tasks by default - bug 1599197
44 r"linux1804-32", # hide linux32 tests - bug 1599197
45 # Test tasks
46 r"web-platform-tests.*backlog", # hide wpt jobs that are not implemented yet - bug 1572820
47 r"-ccov",
48 r"-profiling-", # talos/raptor profiling jobs are run too often
49 r"-32-.*-webgpu", # webgpu gets little benefit from these tests.
50 r"-asan-.*-webgpu",
51 r"-tsan-.*-webgpu",
52 # Hide shippable versions of tests we have opt versions of because the non-shippable
53 # versions are faster to run. This is mostly perf tests.
54 r"-shippable(?!.*(awsy|browsertime|marionette-headless|mochitest-devtools-chrome-fis|raptor|talos|web-platform-tests-wdspec-headless|mochitest-plain-headless))", # noqa - too long
55 r"nightly-simulation",
59 def index_exists(index_path, reason=""):
60 print(f"Looking for existing index {index_path} {reason}...")
61 try:
62 task_id = find_task_id(index_path)
63 print(f"Index {index_path} exists: taskId {task_id}")
64 return True
65 except KeyError:
66 print(f"Index {index_path} doesn't exist.")
67 return False
70 def filter_out_shipping_phase(task, parameters):
71 return (
72 # nightly still here because of geckodriver
73 not task.attributes.get("nightly")
74 and task.attributes.get("shipping_phase") in (None, "build")
78 def filter_out_devedition(task, parameters):
79 return not task.attributes.get("shipping_product") == "devedition"
82 def filter_out_cron(task, parameters):
83 """
84 Filter out tasks that run via cron.
85 """
86 return not task.attributes.get("cron")
89 def filter_for_project(task, parameters):
90 """Filter tasks by project. Optionally enable nightlies."""
91 run_on_projects = set(task.attributes.get("run_on_projects", []))
92 return match_run_on_projects(parameters["project"], run_on_projects)
95 def filter_for_hg_branch(task, parameters):
96 """Filter tasks by hg branch.
97 If `run_on_hg_branch` is not defined, then task runs on all branches"""
98 run_on_hg_branches = set(task.attributes.get("run_on_hg_branches", ["all"]))
99 return match_run_on_hg_branches(parameters["hg_branch"], run_on_hg_branches)
102 def filter_on_platforms(task, platforms):
103 """Filter tasks on the given platform"""
104 platform = task.attributes.get("build_platform")
105 return platform in platforms
108 def filter_by_uncommon_try_tasks(task, optional_filters=None):
109 """Filters tasks that should not be commonly run on try.
111 Args:
112 task (str): String representing the task name.
113 optional_filters (list, optional):
114 Additional filters to apply to task filtering.
116 Returns:
117 (Boolean): True if task does not match any known filters.
118 False otherwise.
120 filters = UNCOMMON_TRY_TASK_LABELS
121 if optional_filters:
122 filters = itertools.chain(filters, optional_filters)
124 return not any(re.search(pattern, task) for pattern in filters)
127 def filter_by_regex(task_label, regexes, mode="include"):
128 """Filters tasks according to a list of pre-compiled reguar expressions.
130 If mode is "include", a task label must match any regex to pass.
131 If it is "exclude", a task label must _not_ match any regex to pass.
133 if not regexes:
134 return True
136 assert mode in ["include", "exclude"]
138 any_match = any(r.search(task_label) for r in regexes)
139 if any_match:
140 return mode == "include"
141 return mode != "include"
144 def filter_release_tasks(task, parameters):
145 platform = task.attributes.get("build_platform")
146 if platform in (
147 "linux",
148 "linux64",
149 "macosx64",
150 "win32",
151 "win64",
152 "win64-aarch64",
154 if task.attributes["kind"] == "l10n":
155 # This is on-change l10n
156 return True
157 if (
158 task.attributes["build_type"] == "opt"
159 and task.attributes.get("unittest_suite") != "talos"
160 and task.attributes.get("unittest_suite") != "raptor"
162 return False
164 if task.attributes.get("shipping_phase") not in (None, "build"):
165 return False
167 """ No debug on release, keep on ESR with 4 week cycles, release
168 will not be too different from central, but ESR will live for a long time.
170 From June 2019 -> June 2020, we found 1 unique regression on ESR debug
171 and 5 unique regressions on beta/release. Keeping spidermonkey and linux
172 debug finds all but 1 unique regressions (windows found on try) for beta/release.
174 ...but debug-only failures started showing up on ESR (esr-91, esr-102) so
175 desktop debug tests were added back for beta.
177 build_type = task.attributes.get("build_type", "")
178 build_platform = task.attributes.get("build_platform", "")
179 test_platform = task.attributes.get("test_platform", "")
181 if parameters["release_type"].startswith("esr") or (
182 parameters["release_type"] == "beta" and "android" not in build_platform
184 return True
186 # code below here is intended to reduce release debug tasks
187 if task.kind == "hazard" or "toolchain" in build_platform:
188 # keep hazard and toolchain builds around
189 return True
191 if build_type == "debug":
192 if "linux" not in build_platform:
193 # filter out windows/mac/android
194 return False
195 if task.kind not in ["spidermonkey"] and "-qr" in test_platform:
196 # filter out linux-qr tests, leave spidermonkey
197 return False
198 if "64" not in build_platform:
199 # filter out linux32 builds
200 return False
202 # webrender-android-*-debug doesn't have attributes to find 'debug', using task.label.
203 if task.kind == "webrender" and "debug" in task.label:
204 return False
205 return True
208 def filter_out_missing_signoffs(task, parameters):
209 for signoff in parameters["required_signoffs"]:
210 if signoff not in parameters["signoff_urls"] and signoff in task.attributes.get(
211 "required_signoffs", []
213 return False
214 return True
217 def filter_tests_without_manifests(task, parameters):
218 """Remove test tasks that have an empty 'test_manifests' attribute.
220 This situation can arise when the test loader (e.g bugbug) decided there
221 weren't any important manifests to run for the given push. We filter tasks
222 out here rather than in the transforms so that the full task graph is still
223 aware that the task exists (which is needed by the backfill action).
225 if (
226 task.kind == "test"
227 and "test_manifests" in task.attributes
228 and not task.attributes["test_manifests"]
230 return False
231 return True
234 def standard_filter(task, parameters):
235 return all(
236 filter_func(task, parameters)
237 for filter_func in (
238 filter_out_cron,
239 filter_for_project,
240 filter_for_hg_branch,
241 filter_tests_without_manifests,
246 def accept_raptor_android_build(platform):
247 """Helper function for selecting the correct android raptor builds."""
248 if "android" not in platform:
249 return False
250 if "shippable" not in platform:
251 return False
252 if "p5" in platform and "aarch64" in platform:
253 return False
254 if "p6" in platform and "aarch64" in platform:
255 return True
256 if "s21" in platform and "aarch64" in platform:
257 return True
258 if "a51" in platform:
259 return True
260 return False
263 def accept_raptor_desktop_build(platform):
264 """Helper function for selecting correct desktop raptor builds."""
265 if "android" in platform:
266 return False
267 # ignore all windows 7 perf jobs scheduled automatically
268 if "windows7" in platform or "windows10-32" in platform:
269 return False
270 # Completely ignore all non-shippable platforms
271 if "shippable" in platform:
272 return True
273 return False
276 def accept_awsy_task(try_name, platform):
277 if accept_raptor_desktop_build(platform):
278 if "windows" in platform and "windows11-64" not in platform:
279 return False
280 if "dmd" in try_name:
281 return False
282 if "awsy-base" in try_name:
283 return True
284 if "awsy-tp6" in try_name:
285 return True
286 return False
289 def filter_unsupported_artifact_builds(task, parameters):
290 try_config = parameters.get("try_task_config", {})
291 if not try_config.get("use-artifact-builds", False):
292 return True
294 supports_artifact_builds = task.attributes.get("supports-artifact-builds", True)
295 return supports_artifact_builds
298 def filter_out_shippable(task):
299 return not task.attributes.get("shippable", False)
302 def _try_task_config(full_task_graph, parameters, graph_config):
303 requested_tasks = parameters["try_task_config"]["tasks"]
304 pattern_tasks = [x for x in requested_tasks if x.endswith("-*")]
305 tasks = list(set(requested_tasks) - set(pattern_tasks))
306 matched_tasks = []
307 missing = set()
308 for pattern in pattern_tasks:
309 found = [
311 for t in full_task_graph.graph.nodes
312 if t.split(pattern.replace("*", ""))[-1].isnumeric()
314 if found:
315 matched_tasks.extend(found)
316 else:
317 missing.add(pattern)
319 if "MOZHARNESS_TEST_PATHS" in parameters["try_task_config"].get("env", {}):
320 matched_tasks = [x for x in matched_tasks if x.endswith("-1")]
322 selected_tasks = set(tasks) | set(matched_tasks)
323 missing.update(selected_tasks - set(full_task_graph.tasks))
325 if missing:
326 missing_str = "\n ".join(sorted(missing))
327 logger.warning(
328 f"The following tasks were requested but do not exist in the full task graph and will be skipped:\n {missing_str}"
330 return list(selected_tasks - missing)
333 def _try_option_syntax(full_task_graph, parameters, graph_config):
334 """Generate a list of target tasks based on try syntax in
335 parameters['message'] and, for context, the full task graph."""
336 options = try_option_syntax.TryOptionSyntax(
337 parameters, full_task_graph, graph_config
339 target_tasks_labels = [
340 t.label
341 for t in full_task_graph.tasks.values()
342 if options.task_matches(t)
343 and filter_by_uncommon_try_tasks(t.label)
344 and filter_unsupported_artifact_builds(t, parameters)
347 attributes = {
348 k: getattr(options, k)
349 for k in [
350 "no_retry",
351 "tag",
355 for l in target_tasks_labels:
356 task = full_task_graph[l]
357 if "unittest_suite" in task.attributes:
358 task.attributes["task_duplicates"] = options.trigger_tests
360 for l in target_tasks_labels:
361 task = full_task_graph[l]
362 # If the developer wants test jobs to be rebuilt N times we add that value here
363 if options.trigger_tests > 1 and "unittest_suite" in task.attributes:
364 task.attributes["task_duplicates"] = options.trigger_tests
366 # If the developer wants test talos jobs to be rebuilt N times we add that value here
367 if (
368 options.talos_trigger_tests > 1
369 and task.attributes.get("unittest_suite") == "talos"
371 task.attributes["task_duplicates"] = options.talos_trigger_tests
373 # If the developer wants test raptor jobs to be rebuilt N times we add that value here
374 if (
375 options.raptor_trigger_tests
376 and options.raptor_trigger_tests > 1
377 and task.attributes.get("unittest_suite") == "raptor"
379 task.attributes["task_duplicates"] = options.raptor_trigger_tests
381 task.attributes.update(attributes)
383 # Add notifications here as well
384 if options.notifications:
385 for task in full_task_graph:
386 owner = parameters.get("owner")
387 routes = task.task.setdefault("routes", [])
388 if options.notifications == "all":
389 routes.append(f"notify.email.{owner}.on-any")
390 elif options.notifications == "failure":
391 routes.append(f"notify.email.{owner}.on-failed")
392 routes.append(f"notify.email.{owner}.on-exception")
394 return target_tasks_labels
397 @_target_task("try_tasks")
398 def target_tasks_try(full_task_graph, parameters, graph_config):
399 try_mode = parameters["try_mode"]
400 if try_mode == "try_task_config":
401 return _try_task_config(full_task_graph, parameters, graph_config)
402 if try_mode == "try_option_syntax":
403 return _try_option_syntax(full_task_graph, parameters, graph_config)
404 # With no try mode, we schedule nothing, allowing the user to add tasks
405 # later via treeherder.
406 return []
409 @_target_task("try_select_tasks")
410 def target_tasks_try_select(full_task_graph, parameters, graph_config):
411 tasks = target_tasks_try_select_uncommon(full_task_graph, parameters, graph_config)
412 return [l for l in tasks if filter_by_uncommon_try_tasks(l)]
415 @_target_task("try_select_tasks_uncommon")
416 def target_tasks_try_select_uncommon(full_task_graph, parameters, graph_config):
417 from gecko_taskgraph.decision import PER_PROJECT_PARAMETERS
419 projects = ("autoland", "mozilla-central")
420 if parameters["project"] not in projects:
421 projects = (parameters["project"],)
423 tasks = set()
424 for project in projects:
425 params = dict(parameters)
426 params["project"] = project
427 parameters = Parameters(**params)
429 try:
430 target_tasks_method = PER_PROJECT_PARAMETERS[project]["target_tasks_method"]
431 except KeyError:
432 target_tasks_method = "default"
434 tasks.update(
435 get_method(target_tasks_method)(full_task_graph, parameters, graph_config)
438 return sorted(tasks)
441 @_target_task("try_auto")
442 def target_tasks_try_auto(full_task_graph, parameters, graph_config):
443 """Target the tasks which have indicated they should be run on autoland
444 (rather than try) via the `run_on_projects` attributes.
446 Should do the same thing as the `default` target tasks method.
448 params = dict(parameters)
449 params["project"] = "autoland"
450 parameters = Parameters(**params)
452 regex_filters = parameters["try_task_config"].get("tasks-regex")
453 include_regexes = exclude_regexes = []
454 if regex_filters:
455 include_regexes = [re.compile(r) for r in regex_filters.get("include", [])]
456 exclude_regexes = [re.compile(r) for r in regex_filters.get("exclude", [])]
458 return [
460 for l, t in full_task_graph.tasks.items()
461 if standard_filter(t, parameters)
462 and filter_out_shipping_phase(t, parameters)
463 and filter_out_devedition(t, parameters)
464 and filter_by_uncommon_try_tasks(t.label)
465 and filter_by_regex(t.label, include_regexes, mode="include")
466 and filter_by_regex(t.label, exclude_regexes, mode="exclude")
467 and filter_unsupported_artifact_builds(t, parameters)
468 and filter_out_shippable(t)
472 @_target_task("default")
473 def target_tasks_default(full_task_graph, parameters, graph_config):
474 """Target the tasks which have indicated they should be run on this project
475 via the `run_on_projects` attributes."""
476 return [
478 for l, t in full_task_graph.tasks.items()
479 if standard_filter(t, parameters)
480 and filter_out_shipping_phase(t, parameters)
481 and filter_out_devedition(t, parameters)
485 @_target_task("autoland_tasks")
486 def target_tasks_autoland(full_task_graph, parameters, graph_config):
487 """In addition to doing the filtering by project that the 'default'
488 filter does, also remove any tests running against shippable builds
489 for non-backstop pushes."""
490 filtered_for_project = target_tasks_default(
491 full_task_graph, parameters, graph_config
494 def filter(task):
495 if task.kind != "test":
496 return True
498 if parameters["backstop"]:
499 return True
501 build_type = task.attributes.get("build_type")
503 if not build_type or build_type != "opt" or filter_out_shippable(task):
504 return True
506 return False
508 return [l for l in filtered_for_project if filter(full_task_graph[l])]
511 @_target_task("mozilla_central_tasks")
512 def target_tasks_mozilla_central(full_task_graph, parameters, graph_config):
513 """In addition to doing the filtering by project that the 'default'
514 filter does, also remove any tests running against regular (aka not shippable,
515 asan, etc.) opt builds."""
516 filtered_for_project = target_tasks_default(
517 full_task_graph, parameters, graph_config
520 def filter(task):
521 if task.kind != "test":
522 return True
524 build_platform = task.attributes.get("build_platform")
525 build_type = task.attributes.get("build_type")
526 shippable = task.attributes.get("shippable", False)
528 if not build_platform or not build_type:
529 return True
531 family = platform_family(build_platform)
532 # We need to know whether this test is against a "regular" opt build
533 # (which is to say, not shippable, asan, tsan, or any other opt build
534 # with other properties). There's no positive test for this, so we have to
535 # do it somewhat hackily. Android doesn't have variants other than shippable
536 # so it is pretty straightforward to check for. Other platforms have many
537 # variants, but none of the regular opt builds we're looking for have a "-"
538 # in their platform name, so this works (for now).
539 is_regular_opt = (
540 family == "android" and not shippable
541 ) or "-" not in build_platform
543 if build_type != "opt" or not is_regular_opt:
544 return True
546 return False
548 return [l for l in filtered_for_project if filter(full_task_graph[l])]
551 @_target_task("graphics_tasks")
552 def target_tasks_graphics(full_task_graph, parameters, graph_config):
553 """In addition to doing the filtering by project that the 'default'
554 filter does, also remove artifact builds because we have csets on
555 the graphics branch that aren't on the candidate branches of artifact
556 builds"""
557 filtered_for_project = target_tasks_default(
558 full_task_graph, parameters, graph_config
561 def filter(task):
562 if task.attributes["kind"] == "artifact-build":
563 return False
564 return True
566 return [l for l in filtered_for_project if filter(full_task_graph[l])]
569 @_target_task("mozilla_beta_tasks")
570 def target_tasks_mozilla_beta(full_task_graph, parameters, graph_config):
571 """Select the set of tasks required for a promotable beta or release build
572 of desktop, plus android CI. The candidates build process involves a pipeline
573 of builds and signing, but does not include beetmover or balrog jobs."""
575 return [
577 for l, t in full_task_graph.tasks.items()
578 if filter_release_tasks(t, parameters) and standard_filter(t, parameters)
582 @_target_task("mozilla_release_tasks")
583 def target_tasks_mozilla_release(full_task_graph, parameters, graph_config):
584 """Select the set of tasks required for a promotable beta or release build
585 of desktop, plus android CI. The candidates build process involves a pipeline
586 of builds and signing, but does not include beetmover or balrog jobs."""
588 return [
590 for l, t in full_task_graph.tasks.items()
591 if filter_release_tasks(t, parameters) and standard_filter(t, parameters)
595 @_target_task("mozilla_esr115_tasks")
596 def target_tasks_mozilla_esr115(full_task_graph, parameters, graph_config):
597 """Select the set of tasks required for a promotable beta or release build
598 of desktop, without android CI. The candidates build process involves a pipeline
599 of builds and signing, but does not include beetmover or balrog jobs."""
601 def filter(task):
602 if not filter_release_tasks(task, parameters):
603 return False
605 if not standard_filter(task, parameters):
606 return False
608 platform = task.attributes.get("build_platform")
610 # Android is not built on esr115.
611 if platform and "android" in platform:
612 return False
614 return True
616 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
619 @_target_task("promote_desktop")
620 def target_tasks_promote_desktop(full_task_graph, parameters, graph_config):
621 """Select the superset of tasks required to promote a beta or release build
622 of a desktop product. This should include all non-android
623 mozilla_{beta,release} tasks, plus l10n, beetmover, balrog, etc."""
625 def filter(task):
626 # Bug 1758507 - geckoview ships in the promote phase
627 if not parameters["release_type"].startswith("esr") and is_geckoview(
628 task, parameters
630 return True
632 if task.attributes.get("shipping_product") != parameters["release_product"]:
633 return False
635 # 'secondary' balrog/update verify/final verify tasks only run for RCs
636 if parameters.get("release_type") != "release-rc":
637 if "secondary" in task.kind:
638 return False
640 if not filter_out_missing_signoffs(task, parameters):
641 return False
643 if task.attributes.get("shipping_phase") == "promote":
644 return True
646 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
649 def is_geckoview(task, parameters):
650 return (
651 task.attributes.get("shipping_product") == "fennec"
652 and task.kind in ("beetmover-geckoview", "upload-symbols")
653 and parameters["release_product"] == "firefox"
657 @_target_task("push_desktop")
658 def target_tasks_push_desktop(full_task_graph, parameters, graph_config):
659 """Select the set of tasks required to push a build of desktop to cdns.
660 Previous build deps will be optimized out via action task."""
661 filtered_for_candidates = target_tasks_promote_desktop(
662 full_task_graph,
663 parameters,
664 graph_config,
667 def filter(task):
668 if not filter_out_missing_signoffs(task, parameters):
669 return False
670 # Include promotion tasks; these will be optimized out
671 if task.label in filtered_for_candidates:
672 return True
674 if (
675 task.attributes.get("shipping_product") == parameters["release_product"]
676 and task.attributes.get("shipping_phase") == "push"
678 return True
680 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
683 @_target_task("ship_desktop")
684 def target_tasks_ship_desktop(full_task_graph, parameters, graph_config):
685 """Select the set of tasks required to ship desktop.
686 Previous build deps will be optimized out via action task."""
687 is_rc = parameters.get("release_type") == "release-rc"
688 if is_rc:
689 # ship_firefox_rc runs after `promote` rather than `push`; include
690 # all promote tasks.
691 filtered_for_candidates = target_tasks_promote_desktop(
692 full_task_graph,
693 parameters,
694 graph_config,
696 else:
697 # ship_firefox runs after `push`; include all push tasks.
698 filtered_for_candidates = target_tasks_push_desktop(
699 full_task_graph,
700 parameters,
701 graph_config,
704 def filter(task):
705 if not filter_out_missing_signoffs(task, parameters):
706 return False
707 # Include promotion tasks; these will be optimized out
708 if task.label in filtered_for_candidates:
709 return True
711 if (
712 task.attributes.get("shipping_product") != parameters["release_product"]
713 or task.attributes.get("shipping_phase") != "ship"
715 return False
717 if "secondary" in task.kind:
718 return is_rc
719 return not is_rc
721 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
724 @_target_task("pine_tasks")
725 def target_tasks_pine(full_task_graph, parameters, graph_config):
726 """Bug 1879960 - no reftests or wpt needed"""
727 filtered_for_project = target_tasks_default(
728 full_task_graph, parameters, graph_config
731 def filter(task):
732 suite = task.attributes.get("unittest_suite", "")
733 if "reftest" in suite or "web-platform" in suite:
734 return False
735 return True
737 return [l for l in filtered_for_project if filter(full_task_graph[l])]
740 @_target_task("larch_tasks")
741 def target_tasks_larch(full_task_graph, parameters, graph_config):
742 """Bug 1879213 - only run necessary tasks on larch"""
743 filtered_for_project = target_tasks_default(
744 full_task_graph, parameters, graph_config
747 def filter(task):
748 # no localized builds, no android
749 if (
750 "l10n" in task.kind
751 or "msix" in task.kind
752 or "android" in task.attributes.get("build_platform", "")
753 or (task.kind == "test" and "msix" in task.label)
755 return False
756 # otherwise reduce tests only
757 if task.kind != "test":
758 return True
759 return "browser-chrome" in task.label or "xpcshell" in task.label
761 return [l for l in filtered_for_project if filter(full_task_graph[l])]
764 @_target_task("kaios_tasks")
765 def target_tasks_kaios(full_task_graph, parameters, graph_config):
766 """The set of tasks to run for kaios integration"""
768 def filter(task):
769 # We disable everything in central, and adjust downstream.
770 return False
772 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
775 @_target_task("ship_geckoview")
776 def target_tasks_ship_geckoview(full_task_graph, parameters, graph_config):
777 """Select the set of tasks required to ship geckoview nightly. The
778 nightly build process involves a pipeline of builds and an upload to
779 maven.mozilla.org."""
780 index_path = (
781 f"{graph_config['trust-domain']}.v2.{parameters['project']}.revision."
782 f"{parameters['head_rev']}.taskgraph.decision-ship-geckoview"
784 if os.environ.get("MOZ_AUTOMATION") and retry(
785 index_exists,
786 args=(index_path,),
787 kwargs={
788 "reason": "to avoid triggering multiple nightlies off the same revision",
791 return []
793 def filter(task):
794 # XXX Starting 69, we don't ship Fennec Nightly anymore. We just want geckoview to be
795 # uploaded
796 return task.attributes.get("shipping_product") == "fennec" and task.kind in (
797 "beetmover-geckoview",
798 "upload-symbols",
801 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
804 @_target_task("custom-car_perf_testing")
805 def target_tasks_custom_car_perf_testing(full_task_graph, parameters, graph_config):
806 """Select tasks required for running daily performance tests for custom chromium-as-release."""
808 def filter(task):
809 platform = task.attributes.get("test_platform")
810 attributes = task.attributes
811 if attributes.get("unittest_suite") != "raptor":
812 return False
814 try_name = attributes.get("raptor_try_name")
816 # Desktop and Android selection for CaR
817 if accept_raptor_desktop_build(platform) or accept_raptor_android_build(
818 platform
820 if "browsertime" in try_name and (
821 "custom-car" in try_name or "cstm-car-m" in try_name
823 if "hw-s21" in platform and "speedometer3" not in try_name:
824 return False
825 return True
826 return False
828 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
831 @_target_task("general_perf_testing")
832 def target_tasks_general_perf_testing(full_task_graph, parameters, graph_config):
834 Select tasks required for running performance tests 3 times a week.
837 def filter(task):
838 platform = task.attributes.get("test_platform")
839 attributes = task.attributes
840 if attributes.get("unittest_suite") != "raptor":
841 return False
843 try_name = attributes.get("raptor_try_name")
845 if "tp6-bench" in try_name:
846 return False
848 # Bug 1867669 - Temporarily disable all live site tests
849 if "live" in try_name and "sheriffed" not in try_name:
850 return False
852 # Desktop selection
853 if accept_raptor_desktop_build(platform):
854 # Select some browsertime tasks as desktop smoke-tests
855 if "browsertime" in try_name:
856 if "chrome" in try_name:
857 if "tp6" in try_name and "essential" not in try_name:
858 return False
859 return True
860 if "chromium" in try_name:
861 if "tp6" in try_name and "essential" not in try_name:
862 return False
863 return True
864 # chromium-as-release has it's own cron
865 if "custom-car" in try_name:
866 return False
867 if "-live" in try_name:
868 return True
869 if "-fis" in try_name:
870 return False
871 if "linux" in platform:
872 if "speedometer" in try_name:
873 return True
874 if "safari" and "benchmark" in try_name:
875 return True
876 # Android selection
877 elif accept_raptor_android_build(platform):
878 if "hw-s21" in platform and "speedometer3" not in try_name:
879 return False
880 if "chrome-m" in try_name and (
881 ("ebay" in try_name and "live" not in try_name)
882 or (
883 "live" in try_name
884 and ("facebook" in try_name or "dailymail" in try_name)
887 return False
888 # Ignore all fennec tests here, we run those weekly
889 if "fennec" in try_name:
890 return False
891 # Only run webrender tests
892 if "chrome-m" not in try_name and "-qr" not in platform:
893 return False
894 # Select live site tests
895 if "-live" in try_name:
896 return True
897 # Select fenix resource usage tests
898 if "fenix" in try_name:
899 # Bug 1816421 disable fission perf tests
900 if "-fis" in try_name:
901 return False
902 if "-power" in try_name:
903 return True
904 # Select geckoview resource usage tests
905 if "geckoview" in try_name:
906 # Bug 1816421 disable fission perf tests
907 if "-fis" in try_name:
908 return False
909 # Run cpu+memory, and power tests
910 cpu_n_memory_task = "-cpu" in try_name and "-memory" in try_name
911 power_task = "-power" in try_name
912 # Ignore cpu+memory+power tests
913 if power_task and cpu_n_memory_task:
914 return False
915 if cpu_n_memory_task:
916 return False
917 if power_task:
918 return "browsertime" in try_name
919 # Select browsertime-specific tests
920 if "browsertime" in try_name:
921 # Don't run android CaR sp tests as we already have a cron for this.
922 if "m-car" in try_name:
923 return False
924 if "speedometer" in try_name:
925 return True
926 return False
928 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
931 def make_desktop_nightly_filter(platforms):
932 """Returns a filter that gets all nightly tasks on the given platform."""
934 def filter(task, parameters):
935 return all(
937 filter_on_platforms(task, platforms),
938 filter_for_project(task, parameters),
939 task.attributes.get("shippable", False),
940 # Tests and nightly only builds don't have `shipping_product` set
941 task.attributes.get("shipping_product")
942 in {None, "firefox", "thunderbird"},
943 task.kind not in {"l10n"}, # no on-change l10n
947 return filter
950 @_target_task("sp-perftests")
951 def target_tasks_speedometer_tests(full_task_graph, parameters, graph_config):
952 def filter(task):
953 platform = task.attributes.get("test_platform")
954 attributes = task.attributes
955 if attributes.get("unittest_suite") != "raptor":
956 return False
958 if accept_raptor_desktop_build(platform) or accept_raptor_android_build(
959 platform
961 try_name = attributes.get("raptor_try_name")
962 if "hw-s21" in platform and "speedometer3" not in try_name:
963 return False
964 if (
965 "browsertime" in try_name
966 and "speedometer" in try_name
967 and "chrome" in try_name
969 return True
971 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
974 @_target_task("nightly_linux")
975 def target_tasks_nightly_linux(full_task_graph, parameters, graph_config):
976 """Select the set of tasks required for a nightly build of linux. The
977 nightly build process involves a pipeline of builds, signing,
978 and, eventually, uploading the tasks to balrog."""
979 filter = make_desktop_nightly_filter(
980 {"linux64-shippable", "linux-shippable", "linux-aarch64-shippable"}
982 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
985 @_target_task("nightly_macosx")
986 def target_tasks_nightly_macosx(full_task_graph, parameters, graph_config):
987 """Select the set of tasks required for a nightly build of macosx. The
988 nightly build process involves a pipeline of builds, signing,
989 and, eventually, uploading the tasks to balrog."""
990 filter = make_desktop_nightly_filter({"macosx64-shippable"})
991 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
994 @_target_task("nightly_win32")
995 def target_tasks_nightly_win32(full_task_graph, parameters, graph_config):
996 """Select the set of tasks required for a nightly build of win32 and win64.
997 The nightly build process involves a pipeline of builds, signing,
998 and, eventually, uploading the tasks to balrog."""
999 filter = make_desktop_nightly_filter({"win32-shippable"})
1000 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
1003 @_target_task("nightly_win64")
1004 def target_tasks_nightly_win64(full_task_graph, parameters, graph_config):
1005 """Select the set of tasks required for a nightly build of win32 and win64.
1006 The nightly build process involves a pipeline of builds, signing,
1007 and, eventually, uploading the tasks to balrog."""
1008 filter = make_desktop_nightly_filter({"win64-shippable"})
1009 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
1012 @_target_task("nightly_win64_aarch64")
1013 def target_tasks_nightly_win64_aarch64(full_task_graph, parameters, graph_config):
1014 """Select the set of tasks required for a nightly build of win32 and win64.
1015 The nightly build process involves a pipeline of builds, signing,
1016 and, eventually, uploading the tasks to balrog."""
1017 filter = make_desktop_nightly_filter({"win64-aarch64-shippable"})
1018 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
1021 @_target_task("nightly_asan")
1022 def target_tasks_nightly_asan(full_task_graph, parameters, graph_config):
1023 """Select the set of tasks required for a nightly build of asan. The
1024 nightly build process involves a pipeline of builds, signing,
1025 and, eventually, uploading the tasks to balrog."""
1026 filter = make_desktop_nightly_filter(
1027 {"linux64-asan-reporter-shippable", "win64-asan-reporter-shippable"}
1029 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
1032 @_target_task("daily_releases")
1033 def target_tasks_daily_releases(full_task_graph, parameters, graph_config):
1034 """Select the set of tasks required to identify if we should release.
1035 If we determine that we should the task will communicate to ship-it to
1036 schedule the release itself."""
1038 def filter(task):
1039 return task.kind in ["maybe-release"]
1041 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1044 @_target_task("nightly_desktop")
1045 def target_tasks_nightly_desktop(full_task_graph, parameters, graph_config):
1046 """Select the set of tasks required for a nightly build of linux, mac,
1047 windows."""
1048 index_path = (
1049 f"{graph_config['trust-domain']}.v2.{parameters['project']}.revision."
1050 f"{parameters['head_rev']}.taskgraph.decision-nightly-desktop"
1052 if os.environ.get("MOZ_AUTOMATION") and retry(
1053 index_exists,
1054 args=(index_path,),
1055 kwargs={
1056 "reason": "to avoid triggering multiple nightlies off the same revision",
1059 return []
1061 # Tasks that aren't platform specific
1062 release_filter = make_desktop_nightly_filter({None})
1063 release_tasks = [
1064 l for l, t in full_task_graph.tasks.items() if release_filter(t, parameters)
1066 # Avoid duplicate tasks.
1067 return list(
1068 set(target_tasks_nightly_win32(full_task_graph, parameters, graph_config))
1069 | set(target_tasks_nightly_win64(full_task_graph, parameters, graph_config))
1070 | set(
1071 target_tasks_nightly_win64_aarch64(
1072 full_task_graph, parameters, graph_config
1075 | set(target_tasks_nightly_macosx(full_task_graph, parameters, graph_config))
1076 | set(target_tasks_nightly_linux(full_task_graph, parameters, graph_config))
1077 | set(target_tasks_nightly_asan(full_task_graph, parameters, graph_config))
1078 | set(release_tasks)
1082 # Run Searchfox analysis once daily.
1083 @_target_task("searchfox_index")
1084 def target_tasks_searchfox(full_task_graph, parameters, graph_config):
1085 """Select tasks required for indexing Firefox for Searchfox web site each day"""
1086 return [
1087 "searchfox-linux64-searchfox/debug",
1088 "searchfox-macosx64-searchfox/debug",
1089 "searchfox-win64-searchfox/debug",
1090 "searchfox-android-armv7-searchfox/debug",
1091 "searchfox-ios-searchfox/debug",
1092 "source-test-file-metadata-bugzilla-components",
1093 "source-test-file-metadata-test-info-all",
1094 "source-test-wpt-metadata-summary",
1098 # Run build linux64-plain-clang-trunk/opt on mozilla-central/beta with perf tests
1099 @_target_task("linux64_clang_trunk_perf")
1100 def target_tasks_build_linux64_clang_trunk_perf(
1101 full_task_graph, parameters, graph_config
1103 """Select tasks required to run perf test on linux64 build with clang trunk"""
1105 # Only keep tasks generated from platform `linux1804-64-clang-trunk-qr/opt`
1106 def filter(task_label):
1107 if "linux1804-64-clang-trunk-qr/opt" in task_label:
1108 return True
1109 return False
1111 return [l for l, t in full_task_graph.tasks.items() if filter(t.label)]
1114 # Run Updatebot's cron job 4 times daily.
1115 @_target_task("updatebot_cron")
1116 def target_tasks_updatebot_cron(full_task_graph, parameters, graph_config):
1117 """Select tasks required to run Updatebot's cron job"""
1118 return ["updatebot-cron"]
1121 @_target_task("customv8_update")
1122 def target_tasks_customv8_update(full_task_graph, parameters, graph_config):
1123 """Select tasks required for building latest d8/v8 version."""
1124 return ["toolchain-linux64-custom-v8"]
1127 @_target_task("file_update")
1128 def target_tasks_file_update(full_task_graph, parameters, graph_config):
1129 """Select the set of tasks required to perform nightly in-tree file updates"""
1131 def filter(task):
1132 # For now any task in the repo-update kind is ok
1133 return task.kind in ["repo-update"]
1135 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1138 @_target_task("l10n_bump")
1139 def target_tasks_l10n_bump(full_task_graph, parameters, graph_config):
1140 """Select the set of tasks required to perform l10n bumping."""
1142 def filter(task):
1143 # For now any task in the repo-update kind is ok
1144 return task.kind in ["l10n-bump"]
1146 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1149 @_target_task("merge_automation")
1150 def target_tasks_merge_automation(full_task_graph, parameters, graph_config):
1151 """Select the set of tasks required to perform repository merges."""
1153 def filter(task):
1154 # For now any task in the repo-update kind is ok
1155 return task.kind in ["merge-automation"]
1157 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1160 @_target_task("scriptworker_canary")
1161 def target_tasks_scriptworker_canary(full_task_graph, parameters, graph_config):
1162 """Select the set of tasks required to run scriptworker canaries."""
1164 def filter(task):
1165 # For now any task in the repo-update kind is ok
1166 return task.kind in ["scriptworker-canary"]
1168 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1171 @_target_task("cron_bouncer_check")
1172 def target_tasks_bouncer_check(full_task_graph, parameters, graph_config):
1173 """Select the set of tasks required to perform bouncer version verification."""
1175 def filter(task):
1176 if not filter_for_project(task, parameters):
1177 return False
1178 # For now any task in the repo-update kind is ok
1179 return task.kind in ["cron-bouncer-check"]
1181 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1184 @_target_task("staging_release_builds")
1185 def target_tasks_staging_release(full_task_graph, parameters, graph_config):
1187 Select all builds that are part of releases.
1190 def filter(task):
1191 if not task.attributes.get("shipping_product"):
1192 return False
1193 if parameters["release_type"].startswith(
1194 "esr"
1195 ) and "android" in task.attributes.get("build_platform", ""):
1196 return False
1197 if parameters["release_type"] != "beta" and "devedition" in task.attributes.get(
1198 "build_platform", ""
1200 return False
1201 if task.attributes.get("shipping_phase") == "build":
1202 return True
1203 return False
1205 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1208 @_target_task("release_simulation")
1209 def target_tasks_release_simulation(full_task_graph, parameters, graph_config):
1211 Select builds that would run on push on a release branch.
1213 project_by_release = {
1214 "nightly": "mozilla-central",
1215 "beta": "mozilla-beta",
1216 "release": "mozilla-release",
1217 "esr115": "mozilla-esr115",
1219 target_project = project_by_release.get(parameters["release_type"])
1220 if target_project is None:
1221 raise Exception("Unknown or unspecified release type in simulation run.")
1223 def filter_for_target_project(task):
1224 """Filter tasks by project. Optionally enable nightlies."""
1225 run_on_projects = set(task.attributes.get("run_on_projects", []))
1226 return match_run_on_projects(target_project, run_on_projects)
1228 def filter_out_android_on_esr(task):
1229 if parameters["release_type"].startswith(
1230 "esr"
1231 ) and "android" in task.attributes.get("build_platform", ""):
1232 return False
1233 return True
1235 return [
1237 for l, t in full_task_graph.tasks.items()
1238 if filter_release_tasks(t, parameters)
1239 and filter_out_cron(t, parameters)
1240 and filter_for_target_project(t)
1241 and filter_out_android_on_esr(t)
1245 @_target_task("codereview")
1246 def target_tasks_codereview(full_task_graph, parameters, graph_config):
1247 """Select all code review tasks needed to produce a report"""
1249 def filter(task):
1250 # Ending tasks
1251 if task.kind in ["code-review"]:
1252 return True
1254 # Analyzer tasks
1255 if task.attributes.get("code-review") is True:
1256 return True
1258 return False
1260 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1263 @_target_task("nothing")
1264 def target_tasks_nothing(full_task_graph, parameters, graph_config):
1265 """Select nothing, for DONTBUILD pushes"""
1266 return []
1269 @_target_task("daily_beta_perf")
1270 def target_tasks_daily_beta_perf(full_task_graph, parameters, graph_config):
1272 Select performance tests on the beta branch to be run daily
1274 index_path = (
1275 f"{graph_config['trust-domain']}.v2.{parameters['project']}.revision."
1276 f"{parameters['head_rev']}.taskgraph.decision-daily-beta-perf"
1278 if os.environ.get("MOZ_AUTOMATION") and retry(
1279 index_exists,
1280 args=(index_path,),
1281 kwargs={
1282 "reason": "to avoid triggering multiple daily beta perftests off of the same revision",
1285 return []
1287 def filter(task):
1288 platform = task.attributes.get("test_platform")
1289 attributes = task.attributes
1290 try_name = attributes.get("raptor_try_name") or task.label
1292 unittest_suite = attributes.get("unittest_suite")
1293 if unittest_suite not in ("raptor", "awsy", "talos"):
1294 return False
1295 if not platform:
1296 return False
1298 # Select beta tasks for awsy
1299 if "awsy" in try_name:
1300 if accept_awsy_task(try_name, platform):
1301 return True
1302 return False
1304 # Select beta tasks for talos
1305 if "talos" == unittest_suite:
1306 if accept_raptor_desktop_build(platform):
1307 if "windows11-64" in platform:
1308 if "xperf" in try_name:
1309 return True
1310 return False
1311 if ("mac" in platform or "windows" in platform) and "g3" in try_name:
1312 return False
1313 if "-swr" in try_name:
1314 if "dromaeo" in try_name:
1315 return False
1316 if "perf-reftest-singletons" in try_name:
1317 return False
1318 if "realworldweb" in try_name:
1319 return False
1320 if any(
1321 x in try_name
1322 for x in ("prof", "ipc", "gli", "sessionrestore", "tabswitch")
1324 return False
1325 return True
1326 return False
1328 if accept_raptor_desktop_build(platform):
1329 if "browsertime" and "firefox" in try_name:
1330 if "profiling" in try_name:
1331 return False
1332 if "bytecode" in try_name:
1333 return False
1334 if "live" in try_name:
1335 return False
1336 if "webext" in try_name:
1337 return False
1338 if "unity" in try_name:
1339 return False
1340 if "wasm" in try_name:
1341 return False
1342 if "tp6-bench" in try_name:
1343 return False
1344 if "tp6" in try_name:
1345 return True
1346 if "benchmark" in try_name:
1347 return True
1348 elif accept_raptor_android_build(platform):
1349 # Select browsertime & geckoview specific tests
1350 if "browsertime" and "geckoview" in try_name:
1351 if "power" in try_name:
1352 return False
1353 if "cpu" in try_name:
1354 return False
1355 if "profiling" in try_name:
1356 return False
1357 if "-live" in try_name:
1358 return False
1359 if "speedometer" in try_name:
1360 return True
1361 if "webgl" in try_name:
1362 return True
1363 if "tp6m" in try_name:
1364 return True
1366 return False
1368 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1371 @_target_task("weekly_release_perf")
1372 def target_tasks_weekly_release_perf(full_task_graph, parameters, graph_config):
1374 Select performance tests on the release branch to be run weekly
1377 def filter(task):
1378 platform = task.attributes.get("test_platform")
1379 attributes = task.attributes
1380 try_name = attributes.get("raptor_try_name") or task.label
1382 if attributes.get("unittest_suite") not in ("raptor", "awsy"):
1383 return False
1384 if not platform:
1385 return False
1387 # Select release tasks for awsy
1388 if "awsy" in try_name:
1389 if accept_awsy_task(try_name, platform):
1390 return True
1391 return False
1393 # Select browsertime tests
1394 if accept_raptor_desktop_build(platform):
1395 if "browsertime" and "firefox" in try_name:
1396 if "power" in try_name:
1397 return False
1398 if "profiling" in try_name:
1399 return False
1400 if "bytecode" in try_name:
1401 return False
1402 if "live" in try_name:
1403 return False
1404 if "webext" in try_name:
1405 return False
1406 if "tp6-bench" in try_name:
1407 return False
1408 if "tp6" in try_name:
1409 return True
1410 if "benchmark" in try_name:
1411 return True
1412 if "youtube-playback" in try_name:
1413 return True
1414 elif accept_raptor_android_build(platform):
1415 # Select browsertime & geckoview specific tests
1416 if "browsertime" and "geckoview" in try_name:
1417 if "power" in try_name:
1418 return False
1419 if "cpu" in try_name:
1420 return False
1421 if "profiling" in try_name:
1422 return False
1423 if "-live" in try_name:
1424 return False
1425 if "speedometer" in try_name:
1426 return True
1427 if "webgl" in try_name:
1428 return True
1429 if "tp6m" in try_name:
1430 return True
1431 if "youtube-playback" in try_name:
1432 return True
1434 return False
1436 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1439 @_target_task("raptor_tp6m")
1440 def target_tasks_raptor_tp6m(full_task_graph, parameters, graph_config):
1442 Select tasks required for running raptor cold page-load tests on fenix and refbrow
1445 def filter(task):
1446 platform = task.attributes.get("build_platform")
1447 attributes = task.attributes
1449 if platform and "android" not in platform:
1450 return False
1451 if attributes.get("unittest_suite") != "raptor":
1452 return False
1453 try_name = attributes.get("raptor_try_name")
1454 if "-cold" in try_name and "shippable" in platform:
1455 # Get browsertime amazon smoke tests
1456 if (
1457 "browsertime" in try_name
1458 and "amazon" in try_name
1459 and "search" not in try_name
1460 and "fenix" in try_name
1462 return True
1464 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1467 @_target_task("backfill_all_browsertime")
1468 def target_tasks_backfill_all_browsertime(full_task_graph, parameters, graph_config):
1470 Search for revisions that contains patches that were reviewed by perftest reviewers
1471 and landed the day before the cron is running. Trigger backfill-all-browsertime action
1472 task on each of them.
1474 from gecko_taskgraph.actions.util import get_decision_task_id, get_pushes
1476 def date_is_yesterday(date):
1477 yesterday = datetime.today() - timedelta(days=1)
1478 date = datetime.fromtimestamp(date)
1479 return date.date() == yesterday.date()
1481 def reviewed_by_perftest(push):
1482 try:
1483 commit_message = get_hg_commit_message(
1484 os.path.join(GECKO, graph_config["product-dir"]), rev=push
1486 except Exception as e:
1487 print(e)
1488 return False
1490 for line in commit_message.split("\n\n"):
1491 if line.lower().startswith("bug ") and "r=" in line:
1492 if "perftest-reviewers" in line.split("r=")[-1]:
1493 print(line)
1494 return True
1495 return False
1497 pushes = get_pushes(
1498 project=parameters["head_repository"],
1499 end_id=int(parameters["pushlog_id"]),
1500 depth=200,
1501 full_response=True,
1503 for push_id in sorted([int(p) for p in pushes.keys()], reverse=True):
1504 push_rev = pushes[str(push_id)]["changesets"][-1]
1505 push_info = find_hg_revision_push_info(
1506 "https://hg.mozilla.org/integration/" + parameters["project"], push_rev
1508 pushdate = int(push_info["pushdate"])
1509 if date_is_yesterday(pushdate) and reviewed_by_perftest(push_rev):
1510 from gecko_taskgraph.actions.util import trigger_action
1512 print(
1513 f"Revision {push_rev} was created yesterday and was reviewed by "
1514 f"#perftest-reviewers."
1516 try:
1517 push_decision_task_id = get_decision_task_id(
1518 parameters["project"], push_id
1520 except Exception:
1521 print(f"Could not find decision task for push {push_id}")
1522 continue
1523 try:
1524 trigger_action(
1525 action_name="backfill-all-browsertime",
1526 # This lets the action know on which push we want to add a new task
1527 decision_task_id=push_decision_task_id,
1529 except Exception as e:
1530 print(f"Failed to trigger action for {push_rev}: {e}")
1532 return []
1535 @_target_task("condprof")
1536 def target_tasks_condprof(full_task_graph, parameters, graph_config):
1538 Select tasks required for building conditioned profiles.
1540 for name, task in full_task_graph.tasks.items():
1541 if task.kind == "condprof":
1542 if "a51" not in name: # bug 1765348
1543 yield name
1546 @_target_task("system_symbols")
1547 def target_tasks_system_symbols(full_task_graph, parameters, graph_config):
1549 Select tasks for scraping and uploading system symbols.
1551 for name, task in full_task_graph.tasks.items():
1552 if task.kind in [
1553 "system-symbols",
1554 "system-symbols-upload",
1555 "system-symbols-reprocess",
1557 yield name
1560 @_target_task("perftest")
1561 def target_tasks_perftest(full_task_graph, parameters, graph_config):
1563 Select perftest tasks we want to run daily
1565 for name, task in full_task_graph.tasks.items():
1566 if task.kind != "perftest":
1567 continue
1568 if task.attributes.get("cron", False):
1569 yield name
1572 @_target_task("perftest-on-autoland")
1573 def target_tasks_perftest_autoland(full_task_graph, parameters, graph_config):
1575 Select perftest tasks we want to run daily
1577 for name, task in full_task_graph.tasks.items():
1578 if task.kind != "perftest":
1579 continue
1580 if task.attributes.get("cron", False) and any(
1581 test_name in name for test_name in ["view"]
1583 yield name
1586 @_target_task("l10n-cross-channel")
1587 def target_tasks_l10n_cross_channel(full_task_graph, parameters, graph_config):
1588 """Select the set of tasks required to run l10n cross-channel."""
1590 def filter(task):
1591 return task.kind in ["l10n-cross-channel"]
1593 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1596 @_target_task("are-we-esmified-yet")
1597 def target_tasks_are_we_esmified_yet(full_task_graph, parameters, graph_config):
1599 select the task to track the progress of the esmification project
1601 return [
1602 l for l, t in full_task_graph.tasks.items() if t.kind == "are-we-esmified-yet"
1606 @_target_task("eslint-build")
1607 def target_tasks_eslint_build(full_task_graph, parameters, graph_config):
1608 """Select the task to run additional ESLint rules which require a build."""
1610 for name, task in full_task_graph.tasks.items():
1611 if task.kind != "source-test":
1612 continue
1613 if "eslint-build" in name:
1614 yield name
1617 @_target_task("holly_tasks")
1618 def target_tasks_holly(full_task_graph, parameters, graph_config):
1619 """Bug 1814661: only run updatebot tasks on holly"""
1621 def filter(task):
1622 return task.kind == "updatebot"
1624 return [l for l, t in full_task_graph.tasks.items() if filter(t)]
1627 @_target_task("snap_upstream_tests")
1628 def target_tasks_snap_upstream_tests(full_task_graph, parameters, graph_config):
1630 Select tasks for testing Snap package built as upstream. Omit -try because
1631 it does not really make sense on a m-c cron
1633 for name, task in full_task_graph.tasks.items():
1634 if "snap-upstream-test" in name and not "-try" in name:
1635 yield name
1638 @_target_task("nightly-android")
1639 def target_tasks_nightly_android(full_task_graph, parameters, graph_config):
1640 def filter(task, parameters):
1641 build_type = task.attributes.get("build-type", "")
1642 return build_type in (
1643 "nightly",
1644 "focus-nightly",
1645 "fenix-nightly",
1646 "fenix-nightly-firebase",
1647 "focus-nightly-firebase",
1650 index_path = (
1651 f"{graph_config['trust-domain']}.v2.{parameters['project']}.branch."
1652 f"{parameters['head_ref']}.revision.{parameters['head_rev']}.taskgraph.decision-nightly-android"
1654 if os.environ.get("MOZ_AUTOMATION") and retry(
1655 index_exists,
1656 args=(index_path,),
1657 kwargs={
1658 "reason": "to avoid triggering multiple nightlies off the same revision",
1661 return []
1663 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
1666 @_target_task("android-l10n-import")
1667 def target_tasks_android_l10n_import(full_task_graph, parameters, graph_config):
1668 return [l for l, t in full_task_graph.tasks.items() if l == "android-l10n-import"]