tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 4b33e4795da36fc73e73d8fec76961134908cee6
parent 6c2810f8e125f987d4790623f8bf837a8e3b74da
Author: Andrew Halberstadt <ahal@mozilla.com>
Date:   Mon,  3 Nov 2025 17:46:12 +0000

Bug 1997644 - Vendor taskcluster-taskgraph v17.2.1, r=taskgraph-reviewers,Eijebong

Differential Revision: https://phabricator.services.mozilla.com/D270948

Diffstat:
Mtaskcluster/gecko_taskgraph/test/conftest.py | 5+++++
Mthird_party/python/pyproject.toml | 2+-
Mthird_party/python/requirements.txt | 9++++-----
Athird_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/METADATA | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Athird_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/RECORD | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Athird_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/WHEEL | 4++++
Athird_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/entry_points.txt | 2++
Athird_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/licenses/LICENSE | 373+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthird_party/python/taskcluster_taskgraph/taskgraph/actions/cancel.py | 12++----------
Mthird_party/python/taskcluster_taskgraph/taskgraph/actions/cancel_all.py | 12++----------
Mthird_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py | 1+
Mthird_party/python/taskcluster_taskgraph/taskgraph/run-task/run-task | 9+++++----
Mthird_party/python/taskcluster_taskgraph/taskgraph/transforms/task.py | 140++-----------------------------------------------------------------------------
Mthird_party/python/taskcluster_taskgraph/taskgraph/util/taskcluster.py | 10+++-------
Mthird_party/python/taskcluster_taskgraph/taskgraph/util/verify.py | 130+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mthird_party/python/uv.lock | 8++++----
Mthird_party/python/uv.lock.hash | 3+--
17 files changed, 751 insertions(+), 181 deletions(-)

diff --git a/taskcluster/gecko_taskgraph/test/conftest.py b/taskcluster/gecko_taskgraph/test/conftest.py @@ -71,8 +71,12 @@ def fake_loader(kind, path, config, parameters, loaded_tasks, write_artifacts): "i": i, "metadata": {"name": f"t-{i}"}, "deadline": "soon", + "provisionerId": "prov", + "workerType": "linux", }, "dependencies": dependencies, + "if-dependencies": [], + "soft-dependencies": [], } if "task-defaults" in config: task = merge(config["task-defaults"], task) @@ -191,6 +195,7 @@ def maketgg(monkeypatch): "_kinds": kinds, "backstop": False, "enable_always_target": False, + "level": 1, "target_tasks_method": "test_method", "test_manifest_loader": "default", "try_mode": None, diff --git a/third_party/python/pyproject.toml b/third_party/python/pyproject.toml @@ -57,7 +57,7 @@ dependencies = [ "setuptools==75.3.1", "six~=1.16", "slugid~=2.0", - "taskcluster-taskgraph~=17.2.0", + "taskcluster-taskgraph~=17.2.1", "taskcluster-urls==13.0.1", "taskcluster~=91.0", "toml~=0.10", diff --git a/third_party/python/requirements.txt b/third_party/python/requirements.txt @@ -1038,9 +1038,9 @@ taskcluster==91.1.0 \ # via # mozilla-third-party-python-vendor-dir # taskcluster-taskgraph -taskcluster-taskgraph==17.2.0 \ - --hash=sha256:55218bfe651eaa935a2b8a63aa45532b058051cdbcdeba93cd2c4bcec18453f2 \ - --hash=sha256:87fa392f3716e24daaf9f95b7fc5c8b55c962863e62039b394f0a4269dc008c5 +taskcluster-taskgraph==17.2.1 \ + --hash=sha256:8b3b252d5b23e5244c648e10659ba3306826a0b6c2e573b951558c6183fea54a \ + --hash=sha256:bfb3d3757c9f1345ec6148cfd88b3c2ee3e0791b4411dd3d7e33195583e00660 # via # mozilla-taskgraph # mozilla-third-party-python-vendor-dir @@ -1255,4 +1255,4 @@ yarl==1.20.1 \ zipp==3.23.0 \ --hash=sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e \ --hash=sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166 - # via importlib-metadata -\ No newline at end of file + # via importlib-metadata diff --git a/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/METADATA b/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/METADATA @@ -0,0 +1,131 @@ +Metadata-Version: 2.4 +Name: taskcluster-taskgraph +Version: 17.2.1 +Summary: Build taskcluster taskgraphs +Project-URL: Repository, https://github.com/taskcluster/taskgraph +Project-URL: Issues, https://github.com/taskcluster/taskgraph/issues +Author-email: Mozilla Release Engineering <release+taskgraph@mozilla.com> +License-File: LICENSE +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Software Development +Requires-Python: >=3.9 +Requires-Dist: appdirs>=1.4 +Requires-Dist: cookiecutter~=2.1 +Requires-Dist: json-e>=2.7 +Requires-Dist: mozilla-repo-urls +Requires-Dist: pyyaml>=5.3.1 +Requires-Dist: redo>=2.0 +Requires-Dist: requests>=2.25 +Requires-Dist: slugid>=2.0 +Requires-Dist: taskcluster-urls>=11.0 +Requires-Dist: taskcluster>=91.0 +Requires-Dist: voluptuous>=0.12.1 +Provides-Extra: load-image +Requires-Dist: zstandard; extra == 'load-image' +Provides-Extra: orjson +Requires-Dist: orjson; extra == 'orjson' +Description-Content-Type: text/x-rst + + +.. image:: https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/taskcluster/taskgraph/main/badge.svg + :target: https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/taskcluster/taskgraph/main/latest + :alt: Task Status + +.. image:: https://results.pre-commit.ci/badge/github/taskcluster/taskgraph/main.svg + :target: https://results.pre-commit.ci/latest/github/taskcluster/taskgraph/main + :alt: pre-commit.ci status + +.. image:: https://codecov.io/gh/taskcluster/taskgraph/branch/main/graph/badge.svg?token=GJIV52ZQNP + :target: https://codecov.io/gh/taskcluster/taskgraph + :alt: Code Coverage + +.. image:: https://badge.fury.io/py/taskcluster-taskgraph.svg + :target: https://badge.fury.io/py/taskcluster-taskgraph + :alt: Pypi Version + +.. image:: https://readthedocs.org/projects/taskcluster-taskgraph/badge/?version=latest + :target: https://taskcluster-taskgraph.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/badge/license-MPL%202.0-orange.svg + :target: http://mozilla.org/MPL/2.0 + :alt: License + +Taskgraph +========= + +Taskgraph is a Python library to generate graphs of tasks for the `Taskcluster +CI`_ service. It is the recommended approach for configuring tasks once your +project outgrows a single `.taskcluster.yml`_ file and is what powers the over +30,000 tasks and counting that make up Firefox's CI. + +For more information and usage instructions, `see the docs`_. + +How It Works +------------ + +Taskgraph leverages the fact that Taskcluster is a generic task execution +platform. This means that tasks can be scheduled via its `comprehensive API`_, +and aren't limited to being triggered in response to supported events. + +Taskgraph leverages this execution platform to allow CI systems to scale to any +size or complexity. + +1. A *decision task* is created via Taskcluster's normal `.taskcluster.yml`_ + file. This task invokes ``taskgraph``. +2. Taskgraph evaluates a series of yaml based task definitions (similar to + those other CI offerings provide). +3. Taskgraph applies transforms on top of these task definitions. Transforms + are Python functions that can programmatically alter or even clone a task + definition. +4. Taskgraph applies some optional optimization logic to remove unnecessary + tasks. +5. Taskgraph submits the resulting *task graph* to Taskcluster via its API. + +Taskgraph's combination of declarative task configuration combined with +programmatic alteration are what allow it to support CI systems of any scale. +Taskgraph is the library that powers the 30,000+ tasks making up `Firefox's +CI`_. + +.. _Taskcluster CI: https://taskcluster.net/ +.. _comprehensive API: https://docs.taskcluster.net/docs/reference/platform/queue/api +.. _.taskcluster.yml: https://docs.taskcluster.net/docs/reference/integrations/github/taskcluster-yml-v1 +.. _Firefox's CI: https://treeherder.mozilla.org/jobs?repo=mozilla-central +.. _see the docs: https://taskcluster-taskgraph.readthedocs.io + +Installation +------------ + +Taskgraph supports Python 3.8 and up, and can be installed from Pypi: + +.. code-block:: + + pip install taskcluster-taskgraph + + +Alternatively, the repo can be cloned and installed directly: + +.. code-block:: + + git clone https://github.com/taskcluster/taskgraph + cd taskgraph + pip install . + +In both cases, it's recommended to use a Python `virtual environment`_. + +.. _virtual environment: https://docs.python.org/3/tutorial/venv.html + +Get Involved +------------ + +If you'd like to get involved, please see our `contributing docs`_! + +.. _contributing docs: https://github.com/taskcluster/taskgraph/blob/main/CONTRIBUTING.rst diff --git a/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/RECORD b/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/RECORD @@ -0,0 +1,81 @@ +taskgraph/__init__.py,sha256=VLGPk54XozpA7n-vK1zfGjb08cHFy5qAvIb0vgTT-b0,788 +taskgraph/config.py,sha256=Z5VrOR-gCRt0td7e_SV-4P30dIZIyi6cS3A45gMl1RI,6474 +taskgraph/create.py,sha256=DNzr_Tn22tBtpLA49kxH-0iNPJX1rn8tXWR3A8Sv3WA,4865 +taskgraph/decision.py,sha256=fCUHZrGP0FzToEl3XJ8lLADHZRlWdFqzUywrcBpUqOA,11264 +taskgraph/docker.py,sha256=03tvkcV_HUfGOlnVH9j0aHhQ_NUw568wkNoR1Gi7WB0,21205 +taskgraph/filter_tasks.py,sha256=R7tYXiaVPGIkQ6O1c9-QJrKZ59m9pFXCloUlPraVnZU,866 +taskgraph/generator.py,sha256=2txkc0pBHk3H8uvmXTyEI_OlIF3cbcZujZWBLkViPCk,21762 +taskgraph/graph.py,sha256=9l95V_wgxLUpFdY1mYHCrlwk9YT4hRNk2nlvuhC2r-o,5997 +taskgraph/main.py,sha256=dlPmudwSwzQLAaeT-5DdX76BHWWyDj1QyCwi6gBlI4Q,36814 +taskgraph/morph.py,sha256=p-PXoDrB842vgvArH_ZjWF6XjJg-KbS2ApGAuPIp5xM,9205 +taskgraph/parameters.py,sha256=MA7mrOWuiu3l0tI0NLkiGgfgulkbQ885d1dfCOhSjNU,12406 +taskgraph/target_tasks.py,sha256=9_v66bzmQFELPsfIDGITXrqzsmEiLq1EeuJFhycKL0M,3356 +taskgraph/task.py,sha256=81j1hqOUn_pkF5OQ6GQYiy0NqMVUvdYA4BoFg4kY81A,3222 +taskgraph/taskgraph.py,sha256=QOEWiCB-5tEgY9AqyI5H8Z8zIUzaa_Yf1RMzmd5g23I,2421 +taskgraph/actions/__init__.py,sha256=lVP1e0YyELg7-_42MWWDbT0cKv_p53BApVE6vWOiPww,416 +taskgraph/actions/add_new_jobs.py,sha256=hpAVTu8hP26cBYHQK07R_6RRFvqzFtZpL0SbtN_Wy1Q,1847 +taskgraph/actions/cancel.py,sha256=TK8XqQY0xDvd0i7O1vr2YR9pLxi581LcR0_GLC0CBUY,1254 +taskgraph/actions/cancel_all.py,sha256=B_4XNBkhpn1EI5DbsEd3DzYtnMR0jOK2GDidFCPsfj4,1878 +taskgraph/actions/rebuild_cached_tasks.py,sha256=Xvh7bfSWs9aPTkF3GSKU-GFS2vLIt4Hk1HDWzBBDGh4,1154 +taskgraph/actions/registry.py,sha256=zYOPurPlLsYba2qVCv_HOjONXvoJU5I2GQ-GsIo2I9U,13625 +taskgraph/actions/retrigger.py,sha256=aKzUTuUAec-IBm6sncvBh_DGeBPYIERmWYHxlIMlPxM,9530 +taskgraph/actions/util.py,sha256=1WvJU3-6XIh56lgmmXt8ZTLMbVCtDgkRxuvWdVDJkUw,11394 +taskgraph/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +taskgraph/loader/default.py,sha256=edRFe4m3efYQ7JAI9tQDWMJBc3RTUHNepLJUhbbiUkI,1219 +taskgraph/loader/transform.py,sha256=_PPHSLdnqa8MUlXqIZSkRsGAndQBVTZjNLAaIUVU5ps,2164 +taskgraph/optimize/__init__.py,sha256=Oqpq1RW8QzOcu7zaMlNQ3BHT9ws9e_93FWfCqzNcQps,123 +taskgraph/optimize/base.py,sha256=c2ETEJChLCFm6yoA-IcWepu7V0eOIA_e_tQfFwld-EA,20449 +taskgraph/optimize/strategies.py,sha256=SAzMXbp_oQ3EJ2pDLOvShh2RosJExCRTZR4PFsD-3l0,3776 +taskgraph/run-task/fetch-content,sha256=nX15jqby8Y71ID9fSpt6ZYC2aqCYKAIgOxb_3m-Sjg4,36024 +taskgraph/run-task/hgrc,sha256=BybWLDR89bWi3pE5T05UqmDHs02CbLypE-omLZWU6Uk,896 +taskgraph/run-task/robustcheckout.py,sha256=DZ-MB68P7FmZY1vkj7o3Xp-d21aOiFnLMimv25S3FTs,30778 +taskgraph/run-task/run-task,sha256=kCSZsP5ltITeWqOI2Dn1tzyzxTfV6INrCu3hprK2w80,45372 +taskgraph/transforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +taskgraph/transforms/base.py,sha256=NULQNfwJfBTo0Bem1hp_6aDztUABwbnJrQ0MBpOgGDE,5125 +taskgraph/transforms/cached_tasks.py,sha256=Omg7NGnig-ts3Gq_3oB9YQQ4lQW_KGCP0tL76WBYB3k,2743 +taskgraph/transforms/chunking.py,sha256=-eE_20WAr7SRC7hUpMHo7oBePkWx3r0wodQZ3ePP7UQ,2626 +taskgraph/transforms/code_review.py,sha256=6z4Kc9e812PXwnDbCfDG_ZpUY6vrUpd4U59_5Ss0O9E,712 +taskgraph/transforms/docker_image.py,sha256=eMfsA8VuKWmlJqbl4ZLatszUNXyzKoC8xaiTTXKw38Y,8640 +taskgraph/transforms/fetch.py,sha256=lHHO4NL-HB8su5koFqPOfYczQDIb6mcmFLgWnfyngsw,11247 +taskgraph/transforms/from_deps.py,sha256=a2TrurN-l9-Pq2Cse_XmxEe0pFxa9STNojEzwSLm4CM,9062 +taskgraph/transforms/matrix.py,sha256=CdJj4Vbehd4Zly4siv-VL4ZYU-9MNkAeP28CG3bQzpo,3454 +taskgraph/transforms/notify.py,sha256=v4BkR7rTIXkU-lQcEsN3PS4cyRx104hVWBSDfOOSbdk,6031 +taskgraph/transforms/task.py,sha256=kZVr-Tw3Lw72YKu7HcEMwikXhuxAkegqswiy9SfCal0,52416 +taskgraph/transforms/task_context.py,sha256=ku_22gXkd-OU89R0fZLQlQXBU6I3Tr3JPURMN6uZJu8,4294 +taskgraph/transforms/run/__init__.py,sha256=L9R02lJg1-pUt7z7STEFAsA5uYhc2LU4T8zIOC6AQVg,18922 +taskgraph/transforms/run/common.py,sha256=iIRZ6Bo4j_cTvOCBJgVkiGffiEEF_aVC4wjvSorRklw,6876 +taskgraph/transforms/run/index_search.py,sha256=JlbHD76JbW5TV1i5xWWKy6UWuwmjBHuq2O-QDZmliEo,1261 +taskgraph/transforms/run/run_task.py,sha256=775XCVOClPUGsIxJKhvSEj1ixMkR89eYaCC5DSwk7sg,9109 +taskgraph/transforms/run/toolchain.py,sha256=jgcAD2gcSBe2aWurZ3CEW4brjbgv6StZ2YtmLef3EOI,7276 +taskgraph/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +taskgraph/util/archive.py,sha256=4XcH0FvUZIDs6MYzopFVlItM5J5JllFEXg9buZB3QVc,5104 +taskgraph/util/attributes.py,sha256=pPOFmwkDQQ-IqfDpVghZ10YI_qXRY4Bi5JP3xr6XVvc,2964 +taskgraph/util/cached_tasks.py,sha256=GKL3X_Pp0bQE96IdIP6PnDM7XTgecWyhbiGuC2H7KVI,4180 +taskgraph/util/caches.py,sha256=-5wsP36AYald5dkxNCrHe1ALEDg-y4Ac0NToQLvmM8c,1898 +taskgraph/util/copy.py,sha256=-AgF3oPF3lfiUHvAOiGkhUzS68i9kcWRsyDSiBkAVCw,1577 +taskgraph/util/dependencies.py,sha256=QZIu7ehh_RhZkrwCzaru8oPLUdlvUOiFTYEd-ZmKVkQ,2694 +taskgraph/util/docker.py,sha256=WhRP225JRFWr_r6YkIg38Q_mrWrHqrmH8v6HiHJuT34,8290 +taskgraph/util/hash.py,sha256=BcUR92PJACMtAms3OAUf2zfbT_uaeTE6ua0BawHPIZw,1653 +taskgraph/util/json.py,sha256=z3EMUEXY76lvVtgV8VgB_OFFht2xjtnmBwJM-JSqvRg,1814 +taskgraph/util/keyed_by.py,sha256=TFuF7NkBpst4ZILDN6c-1ZiRnTyOrZleASVTQN5MVTE,4446 +taskgraph/util/parameterization.py,sha256=1fpLadEI4wtQTH7gDaxWoLX9ZVJEe0NAzX6Z41BW9Gs,3559 +taskgraph/util/path.py,sha256=hI8qdch0hOw9rcO-3YDn6pMK1GRrdZ7MdyqURUx9TO4,4465 +taskgraph/util/python_path.py,sha256=6QEs5rzcoDqkJHEN8-UvFlTJgP3cOJnGKuhnyuwoO3E,1590 +taskgraph/util/readonlydict.py,sha256=4D9ZV9nqvVO86Jjv12GCmrd5xiOeqJ0IrukjLsAAHFE,1223 +taskgraph/util/schema.py,sha256=OGkDqlB1igJ4RMibqc8ro7yOBK4azL0YtrhAB1sw7hk,8106 +taskgraph/util/set_name.py,sha256=vRsSD3GAn7BvyQXOYa52Up5K3_cU6ZhXD351p7i9qm4,1134 +taskgraph/util/shell.py,sha256=dQML0222Svp0wW6HbLeXvuBXkEtkXnSlFEUwZW0SCYg,1319 +taskgraph/util/taskcluster.py,sha256=2z5q7Jp7wMvT59D7WQCvBJ-zRp08pMYhi4lefb1oyDU,14853 +taskgraph/util/taskgraph.py,sha256=btSNC9m4WnE5znJul6CdRyCrVY00jQQYMmVSNHgcrv0,2024 +taskgraph/util/templates.py,sha256=R8OCiwfnOTlv9oBwcdHI1D8GVY1zBy3tMWm2q938AD4,2853 +taskgraph/util/time.py,sha256=uEty81ny6MDPb8PBbaf9_Z0Ti0jQPKxNsb-vpv3cOB8,3419 +taskgraph/util/treeherder.py,sha256=kc8jCy_lYduBxVMYOQzWpmI_6i2bRmkQLKq5DGmbiDI,2721 +taskgraph/util/vcs.py,sha256=qhqWH0k6l2iLIYZmCZxK5VsWj_AoC0IjSuO4vAF9kGE,20570 +taskgraph/util/verify.py,sha256=HCLkJnOBClqQVcLg9Daa8XWXqesiOBSEJ89E2RLIU3U,14501 +taskgraph/util/workertypes.py,sha256=SpqQmf99kB9QxtgOdXeMUvzuVv1o0ZVB4lYahZH3jDY,2534 +taskgraph/util/yaml.py,sha256=29h6RE7JA4z0U2V3WCu-S39lPMBS9CEZEglv1delDvw,1075 +taskcluster_taskgraph-17.2.1.dist-info/METADATA,sha256=_zPiE4f0Aeq6OCeiVpZtmSjrla9gxRn5vdF0OyMYiQQ,5035 +taskcluster_taskgraph-17.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 +taskcluster_taskgraph-17.2.1.dist-info/entry_points.txt,sha256=2hxDzE3qq_sHh-J3ROqwpxgQgxO-196phWAQREl2-XA,50 +taskcluster_taskgraph-17.2.1.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 +taskcluster_taskgraph-17.2.1.dist-info/RECORD,, diff --git a/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/WHEEL b/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.27.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/entry_points.txt b/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +taskgraph = taskgraph.main:main diff --git a/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/licenses/LICENSE b/third_party/python/taskcluster_taskgraph/taskcluster_taskgraph-17.2.1.dist-info/licenses/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/actions/cancel.py b/third_party/python/taskcluster_taskgraph/taskgraph/actions/cancel.py @@ -5,8 +5,6 @@ import logging -import requests - from taskcluster import TaskclusterRestFailure from taskgraph.util.taskcluster import cancel_task @@ -28,14 +26,8 @@ def cancel_action(parameters, graph_config, input, task_group_id, task_id): # only cancel tasks with the level-specific schedulerId. try: cancel_task(task_id) - except (requests.HTTPError, TaskclusterRestFailure) as e: - status_code = None - if isinstance(e, requests.HTTPError): - status_code = e.response.status_code if e.response else None - elif isinstance(e, TaskclusterRestFailure): - status_code = e.status_code - - if status_code == 409: + except TaskclusterRestFailure as e: + if e.status_code == 409: # A 409 response indicates that this task is past its deadline. It # cannot be cancelled at this time, but it's also not running # anymore, so we can ignore this error. diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/actions/cancel_all.py b/third_party/python/taskcluster_taskgraph/taskgraph/actions/cancel_all.py @@ -7,8 +7,6 @@ import logging import os from concurrent import futures -import requests - from taskcluster import TaskclusterRestFailure from taskgraph.util.taskcluster import ( CONCURRENCY, @@ -37,14 +35,8 @@ def cancel_all_action(parameters, graph_config, input, task_group_id, task_id): logger.info(f"Cancelling task {task_id}") try: cancel_task(task_id) - except (requests.HTTPError, TaskclusterRestFailure) as e: - status_code = None - if isinstance(e, requests.HTTPError): - status_code = e.response.status_code if e.response else None - elif isinstance(e, TaskclusterRestFailure): - status_code = e.status_code - - if status_code == 409: + except TaskclusterRestFailure as e: + if e.status_code == 409: # A 409 response indicates that this task is past its deadline. It # cannot be cancelled at this time, but it's also not running # anymore, so we can ignore this error. diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py b/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py @@ -437,6 +437,7 @@ def get_subgraph( ) deps = task.task.setdefault("dependencies", []) deps.extend(sorted(named_task_dependencies.values())) + task.dependencies.update(named_task_dependencies) tasks_by_taskid[task.task_id] = task # resolve edges to taskIds diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/run-task/run-task b/third_party/python/taskcluster_taskgraph/taskgraph/run-task/run-task @@ -16,12 +16,10 @@ current time to improve log usefulness. import argparse import datetime import errno -import grp import io import json import os import platform -import pwd import re import shutil import socket @@ -33,7 +31,7 @@ import time import urllib.error import urllib.request from pathlib import Path -from typing import Optional +from typing import Dict, Optional SECRET_BASEURL_TPL = "{}/secrets/v1/secret/{{}}".format( os.environ.get("TASKCLUSTER_PROXY_URL", "http://taskcluster").rstrip("/") @@ -311,6 +309,9 @@ def run_command(prefix, args, *, extra_env=None, cwd=None): def get_posix_user_group(user, group): + import grp # noqa: PLC0415 + import pwd # noqa: PLC0415 + try: user_record = pwd.getpwnam(user) except KeyError: @@ -572,7 +573,7 @@ def git_fetch( remote: str = "origin", tags: bool = False, shallow: bool = False, - env: Optional[dict[str, str]] = None, + env: Optional[Dict[str, str]] = None, ): args = ["git", "fetch"] if tags: diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/transforms/task.py b/third_party/python/taskcluster_taskgraph/taskgraph/transforms/task.py @@ -11,7 +11,6 @@ complexities of worker implementations, scopes, and treeherder annotations. import functools import hashlib import os -import re import time from copy import deepcopy from dataclasses import dataclass @@ -20,7 +19,6 @@ from typing import Callable from voluptuous import All, Any, Extra, NotIn, Optional, Required -from taskgraph import MAX_DEPENDENCIES from taskgraph.transforms.base import TransformSequence from taskgraph.util.hash import hash_path from taskgraph.util.keyed_by import evaluate_keyed_by @@ -44,7 +42,7 @@ RUN_TASK = os.path.join( @functools.cache -def _run_task_suffix(): +def run_task_suffix(): """String to append to cache names under control of run-task.""" return hash_path(RUN_TASK)[0:20] @@ -715,7 +713,7 @@ def build_docker_worker_payload(config, task, task_def): cache_version = "v3" if run_task: - suffix = f"{cache_version}-{_run_task_suffix()}" + suffix = f"{cache_version}-{run_task_suffix()}" if out_of_tree_image: name_hash = hashlib.sha256( @@ -763,8 +761,6 @@ def build_docker_worker_payload(config, task, task_def): if capabilities: payload["capabilities"] = capabilities - check_caches_are_volumes(task) - @payload_builder( "generic-worker", @@ -1457,135 +1453,3 @@ def chain_of_trust(config, tasks): "task-reference": "<docker-image>" } yield task - - -@transforms.add -def check_task_identifiers(config, tasks): - """Ensures that all tasks have well defined identifiers: - ``^[a-zA-Z0-9_-]{1,38}$`` - """ - e = re.compile("^[a-zA-Z0-9_-]{1,38}$") - for task in tasks: - for attrib in ("workerType", "provisionerId"): - if not e.match(task["task"][attrib]): - raise Exception( - "task {}.{} is not a valid identifier: {}".format( - task["label"], attrib, task["task"][attrib] - ) - ) - yield task - - -@transforms.add -def check_task_dependencies(config, tasks): - """Ensures that tasks don't have more than 100 dependencies.""" - for task in tasks: - number_of_dependencies = ( - len(task["dependencies"]) - + len(task["if-dependencies"]) - + len(task["soft-dependencies"]) - ) - if number_of_dependencies > MAX_DEPENDENCIES: - raise Exception( - "task {}/{} has too many dependencies ({} > {})".format( - config.kind, - task["label"], - number_of_dependencies, - MAX_DEPENDENCIES, - ) - ) - yield task - - -def check_caches_are_volumes(task): - """Ensures that all cache paths are defined as volumes. - - Caches and volumes are the only filesystem locations whose content - isn't defined by the Docker image itself. Some caches are optional - depending on the task environment. We want paths that are potentially - caches to have as similar behavior regardless of whether a cache is - used. To help enforce this, we require that all paths used as caches - to be declared as Docker volumes. This check won't catch all offenders. - But it is better than nothing. - """ - volumes = set(task["worker"]["volumes"]) - paths = {c["mount-point"] for c in task["worker"].get("caches", [])} - missing = paths - volumes - - if not missing: - return - - raise Exception( - "task {} (image {}) has caches that are not declared as " - "Docker volumes: {} " - "(have you added them as VOLUMEs in the Dockerfile?)".format( - task["label"], task["worker"]["docker-image"], ", ".join(sorted(missing)) - ) - ) - - -@transforms.add -def check_run_task_caches(config, tasks): - """Audit for caches requiring run-task. - - run-task manages caches in certain ways. If a cache managed by run-task - is used by a non run-task task, it could cause problems. So we audit for - that and make sure certain cache names are exclusive to run-task. - - IF YOU ARE TEMPTED TO MAKE EXCLUSIONS TO THIS POLICY, YOU ARE LIKELY - CONTRIBUTING TECHNICAL DEBT AND WILL HAVE TO SOLVE MANY OF THE PROBLEMS - THAT RUN-TASK ALREADY SOLVES. THINK LONG AND HARD BEFORE DOING THAT. - """ - re_reserved_caches = re.compile( - """^ - (checkouts|tooltool-cache) - """, - re.VERBOSE, - ) - - cache_prefix = "{trust_domain}-level-{level}-".format( - trust_domain=config.graph_config["trust-domain"], - level=config.params["level"], - ) - - suffix = _run_task_suffix() - - for task in tasks: - payload = task["task"].get("payload", {}) - command = payload.get("command") or [""] - - main_command = command[0] if isinstance(command[0], str) else "" - run_task = main_command.endswith("run-task") - - for cache in payload.get("cache", {}).get( - "task-reference", payload.get("cache", {}) - ): - if not cache.startswith(cache_prefix): - raise Exception( - "{} is using a cache ({}) which is not appropriate " - "for its trust-domain and level. It should start with {}.".format( - task["label"], cache, cache_prefix - ) - ) - - cache = cache[len(cache_prefix) :] - - if not re_reserved_caches.match(cache): - continue - - if not run_task: - raise Exception( - f"{task['label']} is using a cache ({cache}) reserved for run-task " - "change the task to use run-task or use a different " - "cache name" - ) - - if suffix not in cache: - raise Exception( - f"{task['label']} is using a cache ({cache}) reserved for run-task " - "but the cache name is not dependent on the contents " - "of run-task; change the cache name to conform to the " - "naming requirements" - ) - - yield task diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/util/taskcluster.py b/third_party/python/taskcluster_taskgraph/taskgraph/util/taskcluster.py @@ -467,15 +467,11 @@ def get_ancestors(task_ids: Union[list[str], str]) -> dict[str, str]: for task_id in task_ids: try: task_def = get_task_definition(task_id) - except (requests.HTTPError, taskcluster.TaskclusterRestFailure) as e: + except taskcluster.TaskclusterRestFailure as e: # Task has most likely expired, which means it's no longer a # dependency for the purposes of this function. - if isinstance(e, requests.HTTPError): - if e.response and e.response.status_code == 404: - continue - elif isinstance(e, taskcluster.TaskclusterRestFailure): - if e.status_code == 404: - continue + if e.status_code == 404: + continue raise e dependencies = task_def.get("dependencies", []) diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/util/verify.py b/third_party/python/taskcluster_taskgraph/taskgraph/util/verify.py @@ -4,15 +4,18 @@ import logging +import re import sys import warnings from abc import ABC, abstractmethod from dataclasses import dataclass, field from typing import Callable, Union +from taskgraph import MAX_DEPENDENCIES from taskgraph.config import GraphConfig from taskgraph.parameters import Parameters from taskgraph.taskgraph import TaskGraph +from taskgraph.transforms.task import run_task_suffix from taskgraph.util.attributes import match_run_on_projects from taskgraph.util.treeherder import join_symbol @@ -301,6 +304,133 @@ def verify_toolchain_alias(task, taskgraph, scratch_pad, graph_config, parameter scratch_pad[key] = task.label +RE_RESERVED_CACHES = re.compile(r"^(checkouts|tooltool-cache)", re.VERBOSE) + + +@verifications.add("full_task_graph") +def verify_run_task_caches(task, taskgraph, scratch_pad, graph_config, parameters): + """Audit for caches requiring run-task. + + run-task manages caches in certain ways. If a cache managed by run-task + is used by a non run-task task, it could cause problems. So we audit for + that and make sure certain cache names are exclusive to run-task. + + IF YOU ARE TEMPTED TO MAKE EXCLUSIONS TO THIS POLICY, YOU ARE LIKELY + CONTRIBUTING TECHNICAL DEBT AND WILL HAVE TO SOLVE MANY OF THE PROBLEMS + THAT RUN-TASK ALREADY SOLVES. THINK LONG AND HARD BEFORE DOING THAT. + """ + if task is None: + return + + cache_prefix = "{trust_domain}-level-{level}-".format( + trust_domain=graph_config["trust-domain"], + level=parameters["level"], + ) + + suffix = run_task_suffix() + + payload = task.task.get("payload", {}) + command = payload.get("command") or [""] + + main_command = command[0] if isinstance(command[0], str) else "" + run_task = main_command.endswith("run-task") + + for cache in payload.get("cache", {}).get( + "task-reference", payload.get("cache", {}) + ): + if not cache.startswith(cache_prefix): + raise Exception( + f"{task.label} is using a cache ({cache}) which is not appropriate " + f"for its trust-domain and level. It should start with {cache_prefix}." + ) + + cache = cache[len(cache_prefix) :] + + if not RE_RESERVED_CACHES.match(cache): + continue + + if not run_task: + raise Exception( + f"{task['label']} is using a cache ({cache}) reserved for run-task " + "change the task to use run-task or use a different " + "cache name" + ) + + if suffix not in cache: + raise Exception( + f"{task['label']} is using a cache ({cache}) reserved for run-task " + "but the cache name is not dependent on the contents " + "of run-task; change the cache name to conform to the " + "naming requirements" + ) + + +@verifications.add("full_task_graph") +def verify_task_identifiers(task, taskgraph, scratch_pad, graph_config, parameters): + """Ensures that all tasks have well defined identifiers: + ``^[a-zA-Z0-9_-]{1,38}$`` + """ + if task is None: + return + + e = re.compile("^[a-zA-Z0-9_-]{1,38}$") + for attrib in ("workerType", "provisionerId"): + if not e.match(task.task[attrib]): + raise Exception( + f"task {task.label}.{attrib} is not a valid identifier: {task.task[attrib]}" + ) + + +@verifications.add("full_task_graph") +def verify_task_dependencies(task, taskgraph, scratch_pad, graph_config, parameters): + """Ensures that tasks don't have more than 100 dependencies.""" + if task is None: + return + + number_of_dependencies = ( + len(task.dependencies) + len(task.if_dependencies) + len(task.soft_dependencies) + ) + if number_of_dependencies > MAX_DEPENDENCIES: + raise Exception( + f"task {task.label} has too many dependencies ({number_of_dependencies} > {MAX_DEPENDENCIES})" + ) + + +@verifications.add("full_task_graph") +def verify_caches_are_volumes(task, taskgraph, scratch_pad, graph_config, parameters): + """Ensures that all cache paths are defined as volumes. + + Caches and volumes are the only filesystem locations whose content + isn't defined by the Docker image itself. Some caches are optional + depending on the task environment. We want paths that are potentially + caches to have as similar behavior regardless of whether a cache is + used. To help enforce this, we require that all paths used as caches + to be declared as Docker volumes. This check won't catch all offenders. + But it is better than nothing. + """ + if task is None: + return + + taskdef = task.task + if taskdef.get("worker", {}).get("implementation") != "docker-worker": + return + + volumes = set(taskdef["worker"]["volumes"]) + paths = {c["mount-point"] for c in taskdef["worker"].get("caches", [])} + missing = paths - volumes + + if missing: + raise Exception( + "task {} (image {}) has caches that are not declared as " + "Docker volumes: {} " + "(have you added them as VOLUMEs in the Dockerfile?)".format( + task.label, + taskdef["worker"]["docker-image"], + ", ".join(sorted(missing)), + ) + ) + + @verifications.add("optimized_task_graph") def verify_always_optimized(task, taskgraph, scratch_pad, graph_config, parameters): """ diff --git a/third_party/python/uv.lock b/third_party/python/uv.lock @@ -995,7 +995,7 @@ requires-dist = [ { name = "six", specifier = "~=1.16" }, { name = "slugid", specifier = "~=2.0" }, { name = "taskcluster", specifier = "~=91.0" }, - { name = "taskcluster-taskgraph", specifier = "~=17.2.0" }, + { name = "taskcluster-taskgraph", specifier = "~=17.2.1" }, { name = "taskcluster-urls", specifier = "==13.0.1" }, { name = "toml", specifier = "~=0.10" }, { name = "tomlkit", specifier = "~=0.12" }, @@ -1633,7 +1633,7 @@ wheels = [ [[package]] name = "taskcluster-taskgraph" -version = "17.2.0" +version = "17.2.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "appdirs" }, @@ -1648,9 +1648,9 @@ dependencies = [ { name = "taskcluster-urls" }, { name = "voluptuous" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c5/e0/83aada64eb15b4da8fce1424beaf8974bab63bc705064d41de2e79ed18a7/taskcluster_taskgraph-17.2.0.tar.gz", hash = "sha256:55218bfe651eaa935a2b8a63aa45532b058051cdbcdeba93cd2c4bcec18453f2", size = 509446, upload-time = "2025-10-30T13:37:45.552Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b1/0f/0d3d3bac2dd6a8f3b1c995f061e18991b967af268174b80f57ed509c0212/taskcluster_taskgraph-17.2.1.tar.gz", hash = "sha256:bfb3d3757c9f1345ec6148cfd88b3c2ee3e0791b4411dd3d7e33195583e00660", size = 509684, upload-time = "2025-10-31T20:19:17.721Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/46/12/60e2e9f7160ae79e3dc7b6b5b0037454e30581c280370252f2c5f40d5f17/taskcluster_taskgraph-17.2.0-py3-none-any.whl", hash = "sha256:87fa392f3716e24daaf9f95b7fc5c8b55c962863e62039b394f0a4269dc008c5", size = 205053, upload-time = "2025-10-30T13:37:43.798Z" }, + { url = "https://files.pythonhosted.org/packages/a6/78/2092d271017649caad13350ffbdf482e324b81a3a0d96f6fb89e86715327/taskcluster_taskgraph-17.2.1-py3-none-any.whl", hash = "sha256:8b3b252d5b23e5244c648e10659ba3306826a0b6c2e573b951558c6183fea54a", size = 205020, upload-time = "2025-10-31T20:19:15.987Z" }, ] [[package]] diff --git a/third_party/python/uv.lock.hash b/third_party/python/uv.lock.hash @@ -1 +1 @@ -10cc6c7add64a9ae898d15da2648ec3f87b147673a2037eb3876556b0d137111 -\ No newline at end of file +0b95fbb5a4dd44c0bb73e892d7990cff737414a5da9f310f6ef9a0adb75ba573