From 4da18c2450ce5791cff648b6aa6a75e46297b41a Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Thu, 22 May 2025 13:59:38 -0400 Subject: [PATCH 1/2] fix: add missing mac signed_artifacts Initially I thought this was unused in Gecko, so I ommitted it when copy/pasting the function over to mozilla-taskgraph. But on further testing, we do still use it. Bug: 1961649 --- .../util/signed_artifacts.py | 2 ++ test/util/test_signed_artifacts.py | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/util/test_signed_artifacts.py diff --git a/src/mozilla_taskgraph/util/signed_artifacts.py b/src/mozilla_taskgraph/util/signed_artifacts.py index b72e9de..09b7b06 100644 --- a/src/mozilla_taskgraph/util/signed_artifacts.py +++ b/src/mozilla_taskgraph/util/signed_artifacts.py @@ -10,6 +10,8 @@ def get_signed_artifacts(input, formats, behavior=None): artifacts = set() if input.endswith(".dmg"): artifacts.add(input.replace(".dmg", ".tar.gz")) + if behavior and behavior != "mac_sign": + artifacts.add(input.replace(".dmg", ".pkg")) else: artifacts.add(input) diff --git a/test/util/test_signed_artifacts.py b/test/util/test_signed_artifacts.py new file mode 100644 index 0000000..ab1a9d1 --- /dev/null +++ b/test/util/test_signed_artifacts.py @@ -0,0 +1,22 @@ +import pytest + +from mozilla_taskgraph.util.signed_artifacts import get_signed_artifacts + + +@pytest.mark.parametrize( + "input_file, formats, behavior, expected", + [ + ("example.dmg", [], None, {"example.tar.gz": True, "example.pkg": False}), + ("example.dmg", [], "mac_sign", {"example.tar.gz": True, "example.pkg": False}), + ("example.dmg", [], "other", {"example.tar.gz": True, "example.pkg": True}), + ("example.zip", [], None, {"example.zip": True}), + ("example.zip", ["gcp_prod_autograph_gpg"], None, {"example.zip.asc": True}), + ], +) +def test_get_signed_artifacts(input_file, formats, behavior, expected): + result = get_signed_artifacts(input_file, formats, behavior=behavior) + for artifact, exists in expected.items(): + if exists: + assert artifact in result + else: + assert artifact not in result From 127cba376d5a37ebd8198b06c41c00a0bd6543b3 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Thu, 22 May 2025 14:02:16 -0400 Subject: [PATCH 2/2] chore: version bump 3.1.2 --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d710ba4..2c4aeb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.1.2 (2025-05-22) + +### Fix + +- add missing mac signed_artifacts + ## 3.1.1 (2025-05-22) ### Fix diff --git a/pyproject.toml b/pyproject.toml index 61d89e5..2d23368 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mozilla-taskgraph" -version = "3.1.1" +version = "3.1.2" description = "Mozilla specific transforms and utilities for Taskgraph" readme = "README.md" authors = [ diff --git a/uv.lock b/uv.lock index 06db181..64a136b 100644 --- a/uv.lock +++ b/uv.lock @@ -567,7 +567,7 @@ wheels = [ [[package]] name = "mozilla-taskgraph" -version = "3.1.1" +version = "3.1.2" source = { editable = "." } dependencies = [ { name = "taskcluster-taskgraph" },