From b8918d63a8bdc1835042833b46ce1e5be6813b14 Mon Sep 17 00:00:00 2001 From: tin Date: Tue, 17 Nov 2026 00:10:04 -0600 Subject: [PATCH 1/3] updated write_artifact to handle .mm files and .json.gz files --- src/taskgraph/decision.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/taskgraph/decision.py b/src/taskgraph/decision.py index 7d927ecd8..8bb0619aa 100644 --- a/src/taskgraph/decision.py +++ b/src/taskgraph/decision.py @@ -25,7 +25,7 @@ logger = logging.getLogger(__name__) -ARTIFACTS_DIR = Path("artifacts") +ARTIFACTS_DIR = Path(os.environ.get("MOZ_UPLOAD_DIR", "artifacts")) # For each project, this gives a set of parameters specific to the project. @@ -309,7 +309,13 @@ def write_artifact(filename, data): import gzip # noqa: PLC0415 with gzip.open(path, "wb") as f: - f.write(json.dumps(data)) # type: ignore + if filename.endsWith(".json.gz"): + f.write(json.dumps(data).encode("utf-8")) # type: ignore + else: + f.write(json.dumps(data)) # type: ignore + elif filename.endswith(".mm"): + with open(path, "w") as f: + f.write(data) else: raise TypeError(f"Don't know how to write to {filename}") From c2e83acdb3ffb5c6c8574a796dd42e7e6412dfee Mon Sep 17 00:00:00 2001 From: tin Date: Tue, 17 Nov 2026 01:23:41 -0600 Subject: [PATCH 2/3] undo ARTIFACTS_DIR path --- src/taskgraph/decision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/taskgraph/decision.py b/src/taskgraph/decision.py index 8bb0619aa..41629921e 100644 --- a/src/taskgraph/decision.py +++ b/src/taskgraph/decision.py @@ -25,7 +25,7 @@ logger = logging.getLogger(__name__) -ARTIFACTS_DIR = Path(os.environ.get("MOZ_UPLOAD_DIR", "artifacts")) +ARTIFACTS_DIR = Path("artifacts") # For each project, this gives a set of parameters specific to the project. From 6c4040adbef9b1439783d63c9e94028f17b034f9 Mon Sep 17 00:00:00 2001 From: tin Date: Tue, 17 Nov 2026 17:11:09 -0600 Subject: [PATCH 3/3] corrected syntax error --- src/taskgraph/decision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/taskgraph/decision.py b/src/taskgraph/decision.py index 41629921e..3651dfc00 100644 --- a/src/taskgraph/decision.py +++ b/src/taskgraph/decision.py @@ -309,7 +309,7 @@ def write_artifact(filename, data): import gzip # noqa: PLC0415 with gzip.open(path, "wb") as f: - if filename.endsWith(".json.gz"): + if filename.endswith(".json.gz"): f.write(json.dumps(data).encode("utf-8")) # type: ignore else: f.write(json.dumps(data)) # type: ignore