mozilla-taskgraph 4.0.1__tar.gz → 4.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.github/workflows/pypi-publish.yml +3 -3
  2. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.pre-commit-config.yaml +4 -4
  3. mozilla_taskgraph-4.1.0/.readthedocs.yml +19 -0
  4. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.taskcluster.yml +19 -19
  5. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/CHANGELOG.md +14 -0
  6. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/PKG-INFO +2 -2
  7. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/conf.py +0 -1
  8. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/pyproject.toml +12 -7
  9. mozilla_taskgraph-4.1.0/renovate.json +6 -0
  10. mozilla_taskgraph-4.1.0/src/mozilla_taskgraph/config.py +54 -0
  11. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/transforms/replicate.py +37 -61
  12. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/transforms/scriptworker/release_artifacts.py +9 -10
  13. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/transforms/scriptworker/shipit/mark_as_shipped.py +11 -15
  14. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/worker_types.py +206 -195
  15. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/config.yml +1 -1
  16. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/docker/fetch/Dockerfile +1 -1
  17. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/docker/python/Dockerfile +2 -2
  18. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/actions/test_release_promotion.py +12 -15
  19. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/transforms/test_replicate.py +8 -6
  20. mozilla_taskgraph-4.1.0/uv.lock +2693 -0
  21. mozilla_taskgraph-4.0.1/.readthedocs.yml +0 -13
  22. mozilla_taskgraph-4.0.1/src/mozilla_taskgraph/config.py +0 -26
  23. mozilla_taskgraph-4.0.1/uv.lock +0 -1840
  24. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.codespell-ignore-words.txt +0 -0
  25. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.github/CODEOWNERS +0 -0
  26. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.github/workflows/pre-commit-autoupdate.yml +0 -0
  27. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.github/workflows/pre-commit.yml +0 -0
  28. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.gitignore +0 -0
  29. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/.yamllint +0 -0
  30. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/CODE_OF_CONDUCT.md +0 -0
  31. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/CONTRIBUTING.md +0 -0
  32. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/LICENSE +0 -0
  33. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/Makefile +0 -0
  34. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/README.md +0 -0
  35. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/actions/index.rst +0 -0
  36. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/actions/release-promotion.rst +0 -0
  37. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/index.rst +0 -0
  38. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/transforms/index.rst +0 -0
  39. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/transforms/scriptworker/index.rst +0 -0
  40. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/transforms/scriptworker/release_artifacts.rst +0 -0
  41. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/docs/transforms/scriptworker/ship-it.rst +0 -0
  42. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/__init__.py +0 -0
  43. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/actions/__init__.py +0 -0
  44. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/actions/release_promotion.py +0 -0
  45. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/transforms/__init__.py +0 -0
  46. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/transforms/scriptworker/__init__.py +0 -0
  47. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/transforms/scriptworker/shipit/__init__.py +0 -0
  48. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/util/signed_artifacts.py +0 -0
  49. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/src/mozilla_taskgraph/version.py +0 -0
  50. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/docker/fetch/REGISTRY +0 -0
  51. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/check/kind.yml +0 -0
  52. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/codecov/kind.yml +0 -0
  53. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/complete/kind.yml +0 -0
  54. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/docker-image/kind.yml +0 -0
  55. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/fetch/kind.yml +0 -0
  56. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/release-promotion-dummy/kind.yml +0 -0
  57. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/kinds/test/kind.yml +0 -0
  58. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/mt_taskgraph/target_tasks.py +0 -0
  59. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/mt_taskgraph/transforms/test.py +0 -0
  60. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/taskcluster/scripts/codecov-upload.py +0 -0
  61. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/__init__.py +0 -0
  62. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/actions/__init__.py +0 -0
  63. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/conftest.py +0 -0
  64. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/data/taskcluster/config.yml +0 -0
  65. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/data/testver.py +0 -0
  66. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/test_register.py +0 -0
  67. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/test_version.py +0 -0
  68. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/test_worker_types.py +0 -0
  69. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/transforms/test_scriptworker_release_artifacts.py +0 -0
  70. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/transforms/test_scriptworker_shipit.py +0 -0
  71. {mozilla_taskgraph-4.0.1 → mozilla_taskgraph-4.1.0}/test/util/test_signed_artifacts.py +0 -0
@@ -11,10 +11,10 @@ jobs:
11
11
  id-token: write
12
12
  steps:
13
13
  - name: Checkout sources
14
- uses: actions/checkout@v4
15
- - uses: actions/setup-python@v5
14
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
15
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
16
16
  with:
17
- python-version: '3.11'
17
+ python-version: '3.14'
18
18
  cache: 'pip'
19
19
  - name: Build package distributions
20
20
  run: |
@@ -13,20 +13,20 @@ repos:
13
13
  exclude: template
14
14
  - id: check-added-large-files
15
15
  - repo: https://github.com/astral-sh/uv-pre-commit
16
- rev: 0.9.7
16
+ rev: 0.9.28
17
17
  hooks:
18
18
  - id: uv-lock
19
19
  - repo: https://github.com/astral-sh/ruff-pre-commit
20
- rev: 'v0.14.3'
20
+ rev: 'v0.14.14'
21
21
  hooks:
22
22
  - id: ruff
23
23
  args: [--fix, --exit-non-zero-on-fix]
24
24
  - repo: https://github.com/psf/black
25
- rev: 25.9.0
25
+ rev: 26.1.0
26
26
  hooks:
27
27
  - id: black
28
28
  - repo: https://github.com/adrienverge/yamllint.git
29
- rev: v1.37.1
29
+ rev: v1.38.0
30
30
  hooks:
31
31
  - id: yamllint
32
32
  exclude: template
@@ -0,0 +1,19 @@
1
+ ---
2
+ version: 2
3
+ build:
4
+ os: "ubuntu-24.04"
5
+ tools:
6
+ python: "3.14"
7
+
8
+ jobs:
9
+ pre_create_environment:
10
+ - asdf plugin add uv
11
+ - asdf install uv latest
12
+ - asdf global uv latest
13
+ create_environment:
14
+ - uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
15
+ install:
16
+ - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
17
+
18
+ sphinx:
19
+ configuration: docs/conf.py
@@ -29,7 +29,7 @@ tasks:
29
29
  project:
30
30
  $switch:
31
31
  'tasks_for == "github-push"': '${event.repository.name}'
32
- 'tasks_for[:19] == "github-pull-request"': '${event.pull_request.head.repo.name}'
32
+ 'tasks_for[:19] == "github-pull-request"': '${event.pull_request.base.repo.name}'
33
33
  'tasks_for in ["cron", "action"]': '${repository.project}'
34
34
  head_branch:
35
35
  $switch:
@@ -110,7 +110,7 @@ tasks:
110
110
  description: 'Created by a [cron task](https://firefox-ci-tc.services.mozilla.com/tasks/${cron.task_id})'
111
111
 
112
112
  provisionerId: "${trustDomain}-${level}"
113
- workerType: "decision-gcp"
113
+ workerType: "decision"
114
114
 
115
115
  tags:
116
116
  $switch:
@@ -206,7 +206,7 @@ tasks:
206
206
  features:
207
207
  taskclusterProxy: true
208
208
 
209
- image: mozillareleases/taskgraph:run-task-v13.1.0@sha256:b1b244cfbe0bb07999eaf5b3f3e6d51f22163d726025005c2ea5177e2fea8c6e
209
+ image: mozillareleases/taskgraph:run-task-v19.0.0@sha256:79dccafcfff951ab74c8ca9dea81ff339723da3cef64dbcc1d98c493638e85fe
210
210
  maxRunTime: 1800
211
211
 
212
212
  command:
@@ -258,19 +258,19 @@ tasks:
258
258
  # debugging, but they are not useful long-term.
259
259
  expires: {$fromNow: '7 day'}
260
260
 
261
- extra:
262
- $merge:
263
- - $if: 'tasks_for == "action"'
264
- then:
265
- parent: '${action.taskGroupId}'
266
- action:
267
- name: '${action.name}'
268
- context:
269
- taskGroupId: '${action.taskGroupId}'
270
- taskId: {$eval: 'taskId'}
271
- input: {$eval: 'input'}
272
- clientId: {$eval: 'clientId'}
273
- - $if: 'tasks_for == "cron"'
274
- then:
275
- cron: {$json: {$eval: 'cron'}}
276
- - tasks_for: '${tasks_for}'
261
+ extra:
262
+ $merge:
263
+ - $if: 'tasks_for == "action"'
264
+ then:
265
+ parent: '${action.taskGroupId}'
266
+ action:
267
+ name: '${action.name}'
268
+ context:
269
+ taskGroupId: '${action.taskGroupId}'
270
+ taskId: {$eval: 'taskId'}
271
+ input: {$eval: 'input'}
272
+ clientId: {$eval: 'clientId'}
273
+ - $if: 'tasks_for == "cron"'
274
+ then:
275
+ cron: {$json: {$eval: 'cron'}}
276
+ - tasks_for: '${tasks_for}'
@@ -1,3 +1,17 @@
1
+ ## 4.1.0 (2026-02-17)
2
+
3
+ ### Feat
4
+
5
+ - convert all voluptuous schemas to msgspec
6
+
7
+ ## 4.0.2 (2026-02-06)
8
+
9
+ ### Fix
10
+
11
+ - Change all voluptuous schema names to LegacySchema
12
+ - updated artifact fetch for taskgraph 19 compatibility
13
+ - update readthedocs config
14
+
1
15
  ## 4.0.1 (2025-11-17)
2
16
 
3
17
  ### Fix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mozilla-taskgraph
3
- Version: 4.0.1
3
+ Version: 4.1.0
4
4
  Summary: Mozilla specific transforms and utilities for Taskgraph
5
5
  Project-URL: Repository, https://github.com/mozilla-releng/mozilla-taskgraph
6
6
  Project-URL: Issues, https://github.com/mozilla-releng/mozilla-taskgraph/issues
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Programming Language :: Python :: 3.14
18
18
  Classifier: Topic :: Software Development
19
19
  Requires-Python: >=3.9
20
- Requires-Dist: taskcluster-taskgraph<19,>=16.2.1
20
+ Requires-Dist: taskcluster-taskgraph<20,>=19.1
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  [![Task Status](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-taskgraph/main/badge.svg)](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-taskgraph/main/latest)
@@ -31,7 +31,6 @@ extensions = [
31
31
  "sphinx.ext.autodoc",
32
32
  "sphinx.ext.napoleon",
33
33
  "sphinxarg.ext",
34
- "sphinxcontrib.mermaid",
35
34
  ]
36
35
 
37
36
  # Add any paths that contain templates here, relative to this directory.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mozilla-taskgraph"
3
- version = "4.0.1"
3
+ version = "4.1.0"
4
4
  description = "Mozilla specific transforms and utilities for Taskgraph"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -20,28 +20,33 @@ classifiers = [
20
20
  ]
21
21
  requires-python = ">=3.9"
22
22
  dependencies = [
23
- "taskcluster-taskgraph>=16.2.1,<19",
23
+ "taskcluster-taskgraph>=19.1,<20",
24
24
  ]
25
25
 
26
26
  [project.urls]
27
27
  Repository = "https://github.com/mozilla-releng/mozilla-taskgraph"
28
28
  Issues = "https://github.com/mozilla-releng/mozilla-taskgraph/issues"
29
29
 
30
- [tool.uv]
31
- dev-dependencies = [
30
+ [dependency-groups]
31
+ dev = [
32
32
  "commitizen",
33
33
  "coverage",
34
34
  "pytest",
35
35
  "pytest-mock",
36
36
  "responses",
37
- "sphinx~=5.3.0",
37
+ "taskcluster_urls",
38
+ ]
39
+
40
+ docs = [
41
+ "sphinx~=9.1.0",
38
42
  "sphinx-autobuild",
39
43
  "sphinx-argparse",
40
44
  "sphinx-book-theme",
41
- "sphinxcontrib-mermaid",
42
- "taskcluster_urls",
43
45
  ]
44
46
 
47
+ [tool.uv.dependency-groups]
48
+ docs = {requires-python = ">=3.12"}
49
+
45
50
  [build-system]
46
51
  requires = ["hatchling"]
47
52
  build-backend = "hatchling.build"
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "github>mozilla-releng/reps:renovate-preset.json5"
5
+ ]
6
+ }
@@ -0,0 +1,54 @@
1
+ from textwrap import dedent
2
+ from typing import Optional
3
+
4
+ from taskgraph import config as tg
5
+ from taskgraph.util.schema import Schema
6
+
7
+
8
+ class ShipitConfig(Schema, forbid_unknown_fields=False, kw_only=True):
9
+ product: Optional[str] = None
10
+ release_format: Optional[str] = None
11
+ scope_prefix: Optional[str] = None
12
+
13
+
14
+ if isinstance(tg.graph_config_schema, type) and issubclass(
15
+ tg.graph_config_schema, Schema
16
+ ):
17
+ # New msgspec-based graph_config_schema (upstream or no downstream override).
18
+
19
+ class MozillaGraphConfigSchema(tg.graph_config_schema):
20
+ """Extends the upstream GraphConfigSchema with Mozilla-specific fields."""
21
+
22
+ # Ship It integration settings.
23
+ shipit: Optional[ShipitConfig] = None
24
+ # Python path of the form ``<module>:<obj>`` pointing to a function
25
+ # that takes a set of parameters as input and returns the version
26
+ # string to use for release tasks.
27
+ # Defaults to ``mozilla_taskgraph.version:default_parser``.
28
+ version_parser: Optional[str] = None
29
+
30
+ else:
31
+ # Legacy voluptuous-based graph_config_schema (e.g. gecko_taskgraph override).
32
+ from voluptuous import Optional as Vol_Optional
33
+
34
+ MozillaGraphConfigSchema = tg.graph_config_schema.extend(
35
+ {
36
+ Vol_Optional("shipit"): {
37
+ Vol_Optional("product"): str,
38
+ Vol_Optional("release-format"): str,
39
+ Vol_Optional("scope-prefix"): str,
40
+ },
41
+ Vol_Optional(
42
+ "version-parser",
43
+ description=dedent("""
44
+ Python path of the form ``<module>:<obj>`` pointing to a
45
+ function that takes a set of parameters as input and returns
46
+ the version string to use for release tasks.
47
+
48
+ Defaults to ``mozilla_taskgraph.version:default_parser``.
49
+ """.lstrip()),
50
+ ): str,
51
+ }
52
+ )
53
+
54
+ tg.graph_config_schema = MozillaGraphConfigSchema
@@ -2,11 +2,9 @@
2
2
  # License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
4
 
5
- from __future__ import annotations
6
-
7
5
  import os
8
6
  import re
9
- from textwrap import dedent
7
+ from typing import Optional, Union
10
8
 
11
9
  from taskcluster.exceptions import TaskclusterRestFailure
12
10
  from taskgraph.transforms.base import TransformSequence
@@ -17,64 +15,42 @@ from taskgraph.util.taskcluster import (
17
15
  get_artifact,
18
16
  get_task_definition,
19
17
  )
20
- from voluptuous import ALLOW_EXTRA, Any, Optional, Required
21
-
22
- REPLICATE_SCHEMA = Schema(
23
- {
24
- Required(
25
- "replicate",
26
- description=dedent(
27
- """
28
- Configuration for the replicate transforms.
29
- """.lstrip(),
30
- ),
31
- ): {
32
- Required(
33
- "target",
34
- description=dedent(
35
- """
36
- Define which tasks to target for replication.
37
-
38
- Each item in the list can be either:
39
-
40
- 1. A taskId
41
- 2. An index path that points to a single task
42
-
43
- If any of the resolved tasks are a Decision task, targeted
44
- tasks will be derived from the `task-graph.json` artifact.
45
- """.lstrip()
46
- ),
47
- ): [str],
48
- Optional(
49
- "include-attrs",
50
- description=dedent(
51
- """
52
- A dict of attribute key/value pairs that targeted tasks will be
53
- filtered on. Targeted tasks must *match all* of the given
54
- attributes or they will be ignored.
55
-
56
- Matching is performed by the :func:`~taskgraph.util.attrmatch`
57
- utility function.
58
- """.lstrip(),
59
- ),
60
- ): {str: Any(str, [str])},
61
- Optional(
62
- "exclude-attrs",
63
- description=dedent(
64
- """
65
- A dict of attribute key/value pairs that targeted tasks will be
66
- filtered on. Targeted tasks must *not match any* of the given
67
- attributes or they will be ignored.
68
-
69
- Matching is performed by the :func:`~taskgraph.util.attrmatch`
70
- utility function.
71
- """.lstrip(),
72
- ),
73
- ): {str: Any(str, [str])},
74
- },
75
- },
76
- extra=ALLOW_EXTRA,
77
- )
18
+
19
+
20
+ class ReplicateConfig(Schema):
21
+ """Configuration for the replicate transforms."""
22
+
23
+ # Define which tasks to target for replication.
24
+ #
25
+ # Each item in the list can be either:
26
+ #
27
+ # 1. A taskId
28
+ # 2. An index path that points to a single task
29
+ #
30
+ # If any of the resolved tasks are a Decision task, targeted
31
+ # tasks will be derived from the ``task-graph.json`` artifact.
32
+ target: list[str]
33
+ # A dict of attribute key/value pairs that targeted tasks will be
34
+ # filtered on. Targeted tasks must *match all* of the given
35
+ # attributes or they will be ignored.
36
+ #
37
+ # Matching is performed by the :func:`~taskgraph.util.attrmatch`
38
+ # utility function.
39
+ include_attrs: Optional[dict[str, Union[str, list[str]]]] = None
40
+ # A dict of attribute key/value pairs that targeted tasks will be
41
+ # filtered on. Targeted tasks must *not match any* of the given
42
+ # attributes or they will be ignored.
43
+ #
44
+ # Matching is performed by the :func:`~taskgraph.util.attrmatch`
45
+ # utility function.
46
+ exclude_attrs: Optional[dict[str, Union[str, list[str]]]] = None
47
+
48
+
49
+ class ReplicateSchema(Schema, forbid_unknown_fields=False, kw_only=True):
50
+ replicate: ReplicateConfig
51
+
52
+
53
+ REPLICATE_SCHEMA = ReplicateSchema
78
54
 
79
55
  TASK_ID_RE = re.compile(
80
56
  r"^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$"
@@ -6,25 +6,24 @@ Support a 'release-artifacts' key which automatically sets up the artifacts
6
6
  under 'public/build' and adds the corresponding attribute needed by downstream
7
7
  release tasks.
8
8
  """
9
+
9
10
  import os
11
+ from typing import Optional
10
12
 
11
13
  from taskgraph.transforms.base import TransformSequence
12
- from taskgraph.transforms.task import task_description_schema
14
+ from taskgraph.transforms.task import TaskDescriptionSchema
13
15
  from taskgraph.util.schema import Schema
14
16
  from taskgraph.util.workertypes import worker_type_implementation
15
- from voluptuous import Extra, Optional, Required
16
17
 
17
18
  transforms = TransformSequence()
18
19
 
19
- release_artifacts_schema = Schema(
20
- {
21
- Required("worker-type"): task_description_schema["worker-type"],
22
- Optional("release-artifacts"): [str],
23
- Extra: object,
24
- }
25
- )
26
20
 
27
- transforms.add_validate(release_artifacts_schema)
21
+ class ReleaseArtifactsSchema(Schema, forbid_unknown_fields=False, kw_only=True):
22
+ worker_type: TaskDescriptionSchema.__annotations__["worker_type"] # type: ignore # noqa: F821
23
+ release_artifacts: Optional[list[str]] = None
24
+
25
+
26
+ transforms.add_validate(ReleaseArtifactsSchema)
28
27
 
29
28
 
30
29
  @transforms.add
@@ -4,22 +4,22 @@
4
4
 
5
5
  import os
6
6
  from textwrap import dedent
7
+ from typing import Optional
7
8
 
8
9
  from taskgraph.transforms.base import TransformSequence
9
10
  from taskgraph.util.schema import Schema, optionally_keyed_by, resolve_keyed_by
10
- from voluptuous import Extra, Optional
11
11
 
12
12
  transforms = TransformSequence()
13
13
 
14
- mark_as_shipped_schema = Schema(
15
- {
16
- Optional("name"): str,
17
- Optional("shipit-product"): optionally_keyed_by("build-type", str),
18
- Extra: object,
19
- }
20
- )
21
14
 
22
- transforms.add_validate(mark_as_shipped_schema)
15
+ class MarkAsShippedSchema(Schema, forbid_unknown_fields=False, kw_only=True):
16
+ name: Optional[str] = None
17
+ shipit_product: Optional[
18
+ optionally_keyed_by("build-type", str, use_msgspec=True)
19
+ ] = None
20
+
21
+
22
+ transforms.add_validate(MarkAsShippedSchema)
23
23
 
24
24
 
25
25
  @transforms.add
@@ -60,15 +60,11 @@ def make_task_description(config, tasks):
60
60
 
61
61
  if not product:
62
62
  config_path = os.path.join(config.graph_config.root_dir, "config.yml")
63
- raise Exception(
64
- dedent(
65
- f"""
63
+ raise Exception(dedent(f"""
66
64
  Can't determine ShipIt product!
67
65
 
68
66
  Define it as `shipit-product` in the task definition, or as `shipit.product`
69
- in {config_path}.""".lstrip()
70
- )
71
- )
67
+ in {config_path}.""".lstrip()))
72
68
 
73
69
  task.setdefault("label", task.pop("name", "mark-as-shipped"))
74
70
  task["description"] = f"Mark {product} as shipped in Ship-It"