Registry / devops / mozilla-taskgraph

mozilla-taskgraph

JSON →
library5.0.1pypypi✓ verified 22d ago

mozilla-taskgraph provides Mozilla-specific transforms, utilities, and parameter definitions designed to extend and integrate with the taskcluster-taskgraph framework. It enables the configuration and automation of complex CI/CD processes within Mozilla's infrastructure. The library is actively maintained with frequent updates, currently at version 4.1.1, and follows semver principles.

pip install mozilla-taskgraph
INSTALL
IMPORT
SIG · MOZILLA-TASKGRAPH
M
mozilla-taskgraph
devopspythonv5.0.1
Install
7.9s avg
Import
347ms
Disk
58MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.360s · 56.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.9s · import 0.334s · 59MB
58MB installed
● package 58MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

import_module
from mozilla_taskgraph import import_module
from mozilla_taskgraph.project_config import MozillaProjectConfigBuilder
register
from mozilla_taskgraph import register
schema
from mozilla_taskgraph import schema

This quickstart demonstrates a utility function from `mozilla-taskgraph.util`, accesses a Mozilla-specific parameter definition, and shows how to instantiate the `MozillaProjectConfigBuilder`. `mozilla-taskgraph` provides building blocks that integrate with `taskcluster-taskgraph`; therefore, a full runnable example often requires a `taskcluster-taskgraph` project setup. This example focuses on standalone components where possible.

from mozilla_taskgraph.util.task_names import add_platform_to_task_name from mozilla_taskgraph.parameters import build_parameters from mozilla_taskgraph.project_config import MozillaProjectConfigBuilder # Demonstrating a utility function provided by mozilla-taskgraph print("\n--- Demonstrating a utility function ---") original_name = "build-linux" platform_tag = "x64" new_name = add_platform_to_task_name(original_name, platform_tag) print(f"Original task name: '{original_name}', Platform: '{platform_tag}'") print(f"Transformed task name: '{new_name}'") # Accessing Mozilla-specific parameter definitions (conceptual) print("\n--- Accessing Mozilla-specific parameter definitions ---") # These parameters are typically consumed by other parts of the taskgraph try: # The exact way to access definitions might vary; this is illustrative. print(f"Example parameter definition key: {next(iter(build_parameters.BUILD_PROPERTIES_DEFINITION.keys()))}") except AttributeError: print("Note: Parameter definitions are typically used internally by transforms.") # Illustrating the main configuration builder (requires 'taskcluster-taskgraph') print("\n--- Instantiating MozillaProjectConfigBuilder ---") # In a real setup, 'project_dir' would point to a directory containing .taskcluster.yml # For this quickstart, we'll instantiate it conceptually without requiring actual files. # Note: Full functionality of the builder requires a valid taskgraph project structure. try: # Minimal instantiation, skipping schema validation for quickstart simplicity builder = MozillaProjectConfigBuilder( project_dir=".", schema_validate=False ) print("MozillaProjectConfigBuilder instantiated successfully.") print("This builder extends taskgraph's ProjectConfig to include Mozilla-specific logic and defaults.") except Exception as e: print(f"Could not instantiate MozillaProjectConfigBuilder: {e}") print("Ensure 'taskcluster-taskgraph' is installed and project_dir is correctly set for full functionality.")
taskgraph --version
Debug
Known issues
breakingPython 3.8 support was dropped in version 4.0.0. Projects using `mozilla-taskgraph` must update to Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or higher.
affects: >=4.0.0
gotchaMozilla-taskgraph is tightly coupled with `taskcluster-taskgraph` versions. Ensure the `mozilla-taskgraph` version you use is compatible with your `taskcluster-taskgraph` version, as stated in its release notes (e.g., 'compatible with Taskgraph v18.0.0').
fix
Consult `mozilla-taskgraph` release notes and `pyproject.toml` for compatible `taskcluster-taskgraph` versions.
affects: All versions
gotchaThis library is highly specialized for Mozilla's CI/CD infrastructure and conventions. While its underlying `taskcluster-taskgraph` framework is general, the transforms and utilities in `mozilla-taskgraph` are tailored for Mozilla's specific needs.
fix
Understand that this library is an extension for a specific ecosystem; direct applicability outside Mozilla's context may be limited without significant adaptation.
affects: All versions
breakingChanges related to the migration of 'decision' and 'image' tasks to 'd2g worker pools' were introduced in version 4.0.2. Existing task definitions for these types might require updates to align with the new worker pool configurations.
fix
Review your existing decision and image task definitions and update them to use the 'd2g worker pools' as per Mozilla's latest taskgraph conventions.
affects: >=4.0.2
Upgrade
Version history
5.0.1latest on PyPI · released Aug 7, 2026
Audit
Dependencies
taskcluster-taskgraphrequiredCore dependency; mozilla-taskgraph provides extensions and transforms for the taskcluster-taskgraph framework. It is specified as a direct requirement in pyproject.toml.
Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
mozilla-taskgraph — pip install mozilla-taskgraph · libregistry