gecko_taskgraph package

Subpackages

Submodules

gecko_taskgraph.config module

gecko_taskgraph.decision module

gecko_taskgraph.decision.full_task_graph_to_manifests_by_task(full_task_json)
gecko_taskgraph.decision.full_task_graph_to_runnable_jobs(full_task_json)
gecko_taskgraph.decision.get_decision_parameters(graph_config, options)

Load parameters from the command-line options for ‘taskgraph decision’. This also applies per-project parameters, based on the given project.

gecko_taskgraph.decision.get_existing_tasks(rebuild_kinds, parameters, graph_config)

Find the decision task corresponding to the on-push graph, and return a mapping of labels to task-ids from it. This will skip the kinds specificed by rebuild_kinds.

gecko_taskgraph.decision.read_artifact(filename)
gecko_taskgraph.decision.rename_artifact(src, dest)
gecko_taskgraph.decision.set_decision_indexes(decision_task_id, params, graph_config)
gecko_taskgraph.decision.set_try_config(parameters, task_config_file)
gecko_taskgraph.decision.taskgraph_decision(options, parameters=None)

Run the decision task. This function implements mach taskgraph decision, and is responsible for

  • processing decision task command-line options into parameters

  • running task-graph generation exactly the same way the other mach taskgraph commands do

  • generating a set of artifacts to memorialize the graph

  • calling TaskCluster APIs to create the graph

gecko_taskgraph.decision.try_syntax_from_message(message)

Parse the try syntax out of a commit message, returning ‘’ if none is found.

gecko_taskgraph.decision.try_task_config_schema = <Schema({'tasks': [<class 'str'>], 'browsertime': <class 'bool'>, 'chemspill-prio': <class 'bool'>, 'disable-pgo': <class 'bool'>, 'env': {<class 'str'>: <class 'str'>}, 'gecko-profile': <class 'bool'>, 'gecko-profile-interval': <class 'float'>, 'gecko-profile-entries': <class 'int'>, 'gecko-profile-features': <class 'str'>, 'gecko-profile-threads': <class 'str'>, 'perftest-options': <class 'object'>, 'optimize-strategies': <class 'str'>, 'rebuild': <class 'int'>, 'tasks-regex': {'include': Any(None, [<class 'str'>], msg=None), 'exclude': Any(None, [<class 'str'>], msg=None)}, 'use-artifact-builds': <class 'bool'>, 'worker-overrides': {<class 'str'>: <class 'str'>}, 'routes': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>

Schema for try_task_config.json files.

gecko_taskgraph.decision.write_artifact(filename, data)

gecko_taskgraph.docker module

gecko_taskgraph.files_changed module

Support for optimizing tasks based on the set of files that have changed.

gecko_taskgraph.files_changed.check(params, file_patterns)

Determine whether any of the files changed in the indicated push to https://hg.mozilla.org match any of the given file patterns.

gecko_taskgraph.files_changed.get_changed_files(repository, revision)

Get the set of files changed in the push headed by the given revision. Responses are cached, so multiple calls with the same arguments are OK.

gecko_taskgraph.files_changed.get_locally_changed_files(repo)

gecko_taskgraph.main module

class gecko_taskgraph.main.Command(func, args, kwargs, defaults)

Bases: tuple

args

Alias for field number 1

defaults

Alias for field number 3

func

Alias for field number 0

kwargs

Alias for field number 2

gecko_taskgraph.main.action_callback(options)
gecko_taskgraph.main.argument(*args, **kwargs)
gecko_taskgraph.main.build_image(args)
gecko_taskgraph.main.command(*args, **kwargs)
gecko_taskgraph.main.create_parser()
gecko_taskgraph.main.decision(options)
gecko_taskgraph.main.dump_output(out, path=None, params_spec=None)
gecko_taskgraph.main.format_taskgraph(options, parameters, logfile=None)
gecko_taskgraph.main.format_taskgraph_json(taskgraph)
gecko_taskgraph.main.format_taskgraph_labels(taskgraph)
gecko_taskgraph.main.format_taskgraph_yaml(taskgraph)
gecko_taskgraph.main.generate_taskgraph(options, parameters, logdir)
gecko_taskgraph.main.get_filtered_taskgraph(taskgraph, tasksregex)

Filter all the tasks on basis of a regular expression and returns a new TaskGraph object

gecko_taskgraph.main.get_taskgraph_generator(root, parameters)

Helper function to make testing a little easier.

gecko_taskgraph.main.image_digest(args)
gecko_taskgraph.main.load_image(args)
gecko_taskgraph.main.main(args=['doc', '--upload', '--no-open', '--no-serve', '--fatal-warnings', '--write-url', '/builds/worker/firefox-source-docs-url.txt', '--dump-trees=/builds/worker/artifacts/trees.json'])
gecko_taskgraph.main.setup_logging()
gecko_taskgraph.main.show_taskgraph(options)
gecko_taskgraph.main.test_action_callback(options)

gecko_taskgraph.morph module

Graph morphs are modifications to task-graphs that take place after the optimization phase.

These graph morphs are largely invisible to developers running ./mach locally, so they should be limited to changes that do not modify the meaning of the graph.

gecko_taskgraph.morph.amend_taskgraph(taskgraph, label_to_taskid, to_add)

Add the given tasks to the taskgraph, returning a new taskgraph

gecko_taskgraph.morph.derive_misc_task(target_task, purpose, image, taskgraph, label_to_taskid, parameters, graph_config, dependencies)

Create the shell of a task that depends on dependencies and on the given docker image.

gecko_taskgraph.morph.make_index_task(parent_task, taskgraph, label_to_taskid, parameters, graph_config, index_paths, index_rank, purpose, dependencies)

gecko_taskgraph.parameters module

gecko_taskgraph.parameters.get_app_version(product_dir='browser')
gecko_taskgraph.parameters.get_contents(path)
gecko_taskgraph.parameters.get_defaults(repo_root=None)
gecko_taskgraph.parameters.get_version(product_dir='browser')
gecko_taskgraph.parameters.register_parameters()

gecko_taskgraph.target_tasks module

gecko_taskgraph.target_tasks.accept_raptor_android_build(platform)

Helper function for selecting the correct android raptor builds.

gecko_taskgraph.target_tasks.filter_by_regex(task_label, regexes, mode='include')

Filters tasks according to a list of pre-compiled reguar expressions.

If mode is “include”, a task label must match any regex to pass. If it is “exclude”, a task label must _not_ match any regex to pass.

gecko_taskgraph.target_tasks.filter_by_uncommon_try_tasks(task, optional_filters=None)

Filters tasks that should not be commonly run on try.

Parameters
  • task (str) – String representing the task name.

  • optional_filters (list, optional) – Additional filters to apply to task filtering.

Returns

True if task does not match any known filters.

False otherwise.

Return type

(Boolean)

gecko_taskgraph.target_tasks.filter_for_hg_branch(task, parameters)

Filter tasks by hg branch. If run_on_hg_branch is not defined, then task runs on all branches

gecko_taskgraph.target_tasks.filter_for_project(task, parameters)

Filter tasks by project. Optionally enable nightlies.

gecko_taskgraph.target_tasks.filter_on_platforms(task, platforms)

Filter tasks on the given platform

gecko_taskgraph.target_tasks.filter_out_cron(task, parameters)

Filter out tasks that run via cron.

gecko_taskgraph.target_tasks.filter_out_devedition(task, parameters)
gecko_taskgraph.target_tasks.filter_out_missing_signoffs(task, parameters)
gecko_taskgraph.target_tasks.filter_out_shippable(task)
gecko_taskgraph.target_tasks.filter_out_shipping_phase(task, parameters)
gecko_taskgraph.target_tasks.filter_release_tasks(task, parameters)
gecko_taskgraph.target_tasks.filter_tests_without_manifests(task, parameters)

Remove test tasks that have an empty ‘test_manifests’ attribute.

This situation can arise when the test loader (e.g bugbug) decided there weren’t any important manifests to run for the given push. We filter tasks out here rather than in the transforms so that the full task graph is still aware that the task exists (which is needed by the backfill action).

gecko_taskgraph.target_tasks.filter_unsupported_artifact_builds(task, parameters)
gecko_taskgraph.target_tasks.index_exists(index_path, reason='')
gecko_taskgraph.target_tasks.is_geckoview(task, parameters)
gecko_taskgraph.target_tasks.make_desktop_nightly_filter(platforms)

Returns a filter that gets all nightly tasks on the given platform.

gecko_taskgraph.target_tasks.standard_filter(task, parameters)
gecko_taskgraph.target_tasks.target_tasks_are_we_esmified_yet(full_task_graph, parameters, graph_config)

select the task to track the progress of the esmification project

gecko_taskgraph.target_tasks.target_tasks_autoland(full_task_graph, parameters, graph_config)

In addition to doing the filtering by project that the ‘default’ filter does, also remove any tests running against shippable builds for non-backstop pushes.

gecko_taskgraph.target_tasks.target_tasks_backfill_all_browsertime(full_task_graph, parameters, graph_config)

Search for revisions that contains patches that were reviewed by perftest reviewers and landed the day before the cron is running. Trigger backfill-all-browsertime action task on each of them.

gecko_taskgraph.target_tasks.target_tasks_bouncer_check(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform bouncer version verification.

gecko_taskgraph.target_tasks.target_tasks_build_linux64_clang_trunk_perf(full_task_graph, parameters, graph_config)

Select tasks required to run perf test on linux64 build with clang trunk

gecko_taskgraph.target_tasks.target_tasks_chromium_update(full_task_graph, parameters, graph_config)

Select tasks required for building latest chromium versions.

gecko_taskgraph.target_tasks.target_tasks_codereview(full_task_graph, parameters, graph_config)

Select all code review tasks needed to produce a report

gecko_taskgraph.target_tasks.target_tasks_condprof(full_task_graph, parameters, graph_config)

Select tasks required for building conditioned profiles.

gecko_taskgraph.target_tasks.target_tasks_customv8_update(full_task_graph, parameters, graph_config)

Select tasks required for building latest d8/v8 version.

gecko_taskgraph.target_tasks.target_tasks_daily_beta_perf(full_task_graph, parameters, graph_config)

Select performance tests on the beta branch to be run daily

gecko_taskgraph.target_tasks.target_tasks_daily_releases(full_task_graph, parameters, graph_config)

Select the set of tasks required to identify if we should release. If we determine that we should the task will communicate to ship-it to schedule the release itself.

gecko_taskgraph.target_tasks.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.

gecko_taskgraph.target_tasks.target_tasks_eslint_build(full_task_graph, parameters, graph_config)

Select the task to run additional ESLint rules which require a build.

gecko_taskgraph.target_tasks.target_tasks_file_update(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform nightly in-tree file updates

gecko_taskgraph.target_tasks.target_tasks_general_perf_testing(full_task_graph, parameters, graph_config)

Select tasks required for running performance tests 3 times a week.

gecko_taskgraph.target_tasks.target_tasks_graphics(full_task_graph, parameters, graph_config)

In addition to doing the filtering by project that the ‘default’ filter does, also remove artifact builds because we have csets on the graphics branch that aren’t on the candidate branches of artifact builds

gecko_taskgraph.target_tasks.target_tasks_kaios(full_task_graph, parameters, graph_config)

The set of tasks to run for kaios integration

gecko_taskgraph.target_tasks.target_tasks_l10n_bump(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform l10n bumping.

gecko_taskgraph.target_tasks.target_tasks_l10n_cross_channel(full_task_graph, parameters, graph_config)

Select the set of tasks required to run l10n cross-channel.

gecko_taskgraph.target_tasks.target_tasks_merge_automation(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform repository merges.

gecko_taskgraph.target_tasks.target_tasks_mozilla_beta(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, plus android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_mozilla_central(full_task_graph, parameters, graph_config)

In addition to doing the filtering by project that the ‘default’ filter does, also remove any tests running against regular (aka not shippable, asan, etc.) opt builds.

gecko_taskgraph.target_tasks.target_tasks_mozilla_esr102(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, without android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_mozilla_release(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, plus android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_nightly_asan(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of asan. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_desktop(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of linux, mac, windows.

gecko_taskgraph.target_tasks.target_tasks_nightly_linux(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of linux. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_macosx(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of macosx. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_win32(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of win32 and win64. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_win64(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of win32 and win64. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_win64_aarch64(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of win32 and win64. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nothing(full_task_graph, parameters, graph_config)

Select nothing, for DONTBUILD pushes

gecko_taskgraph.target_tasks.target_tasks_perftest(full_task_graph, parameters, graph_config)

Select perftest tasks we want to run daily

gecko_taskgraph.target_tasks.target_tasks_perftest_autoland(full_task_graph, parameters, graph_config)

Select perftest tasks we want to run daily

gecko_taskgraph.target_tasks.target_tasks_pine(full_task_graph, parameters, graph_config)

Bug 1339179 - no mobile automation needed on pine

gecko_taskgraph.target_tasks.target_tasks_promote_desktop(full_task_graph, parameters, graph_config)

Select the superset of tasks required to promote a beta or release build of a desktop product. This should include all non-android mozilla_{beta,release} tasks, plus l10n, beetmover, balrog, etc.

gecko_taskgraph.target_tasks.target_tasks_push_desktop(full_task_graph, parameters, graph_config)

Select the set of tasks required to push a build of desktop to cdns. Previous build deps will be optimized out via action task.

gecko_taskgraph.target_tasks.target_tasks_raptor_tp6m(full_task_graph, parameters, graph_config)

Select tasks required for running raptor cold page-load tests on fenix and refbrow

gecko_taskgraph.target_tasks.target_tasks_release_simulation(full_task_graph, parameters, graph_config)

Select builds that would run on push on a release branch.

gecko_taskgraph.target_tasks.target_tasks_scriptworker_canary(full_task_graph, parameters, graph_config)

Select the set of tasks required to run scriptworker canaries.

gecko_taskgraph.target_tasks.target_tasks_searchfox(full_task_graph, parameters, graph_config)

Select tasks required for indexing Firefox for Searchfox web site each day

gecko_taskgraph.target_tasks.target_tasks_ship_desktop(full_task_graph, parameters, graph_config)

Select the set of tasks required to ship desktop. Previous build deps will be optimized out via action task.

gecko_taskgraph.target_tasks.target_tasks_ship_geckoview(full_task_graph, parameters, graph_config)

Select the set of tasks required to ship geckoview nightly. The nightly build process involves a pipeline of builds and an upload to maven.mozilla.org.

gecko_taskgraph.target_tasks.target_tasks_staging_release(full_task_graph, parameters, graph_config)

Select all builds that are part of releases.

gecko_taskgraph.target_tasks.target_tasks_system_symbols(full_task_graph, parameters, graph_config)

Select tasks for scraping and uploading system symbols.

gecko_taskgraph.target_tasks.target_tasks_try(full_task_graph, parameters, graph_config)
gecko_taskgraph.target_tasks.target_tasks_try_auto(full_task_graph, parameters, graph_config)

Target the tasks which have indicated they should be run on autoland (rather than try) via the run_on_projects attributes.

Should do the same thing as the default target tasks method.

gecko_taskgraph.target_tasks.target_tasks_try_select(full_task_graph, parameters, graph_config)
gecko_taskgraph.target_tasks.target_tasks_try_select_uncommon(full_task_graph, parameters, graph_config)
gecko_taskgraph.target_tasks.target_tasks_updatebot_cron(full_task_graph, parameters, graph_config)

Select tasks required to run Updatebot’s cron job

gecko_taskgraph.target_tasks.target_tasks_weekly_release_perf(full_task_graph, parameters, graph_config)

Select performance tests on the release branch to be run weekly

gecko_taskgraph.try_option_syntax module

class gecko_taskgraph.try_option_syntax.TryOptionSyntax(parameters, full_task_graph, graph_config)

Bases: object

find_all_attribute_suffixes(graph, prefix)
generate_test_tiers(full_task_graph)
handle_alias(test, all_tests)

Expand a test if its name refers to an alias, returning a list of test dictionaries cloned from the first (to maintain any metadata).

parse_build_types(build_types_arg, full_task_graph)
parse_jobs(jobs_arg)
parse_platforms(options, full_task_graph)
parse_test_chunks(all_tests, tests)

Test flags may include parameters to narrow down the number of chunks in a given push. We don’t model 1 chunk = 1 job in taskcluster so we must check each test flag to see if it is actually specifying a chunk.

parse_test_option(attr_name, test_arg, full_task_graph)

Parse a unittest (-u) or talos (-t) option, in the context of a full task graph containing available unittest_try_name or talos_try_name attributes. There are three cases:

  • test_arg is == ‘none’ (meaning an empty list)

  • test_arg is == ‘all’ (meaning use the list of jobs for that job type)

  • test_arg is comma string which needs to be parsed

parse_test_opts(input_str, all_platforms)

Parse testspec,testspec,.., where each testspec is a test name optionally followed by a list of test platforms or negated platforms in [].

No brackets indicates that tests should run on all platforms for which builds are available. If testspecs are provided, then each is treated, from left to right, as an instruction to include or (if negated) exclude a set of test platforms. A single spec may expand to multiple test platforms via UNITTEST_PLATFORM_PRETTY_NAMES. If the first test spec is negated, processing begins with the full set of available test platforms; otherwise, processing begins with an empty set of test platforms.

task_matches(task)
gecko_taskgraph.try_option_syntax.alias_contains(infix)
gecko_taskgraph.try_option_syntax.alias_matches(pattern)
gecko_taskgraph.try_option_syntax.alias_prefix(prefix)
gecko_taskgraph.try_option_syntax.escape_whitespace_in_brackets(input_str)

In tests you may restrict them by platform [] inside of the brackets whitespace may occur this is typically invalid shell syntax so we escape it with backslash sequences .

gecko_taskgraph.try_option_syntax.parse_message(message)
gecko_taskgraph.try_option_syntax.split_try_msg(message)

Module contents

gecko_taskgraph.register(graph_config)

Used to register Gecko specific extensions.

Parameters

graph_config – The graph configuration object.