Skip to content

feat(decision): make the artifact directory configurable - #1118

Open
jcarterbohan wants to merge 1 commit into
taskcluster:mainfrom
jcarterbohan:decision-artifact-directory
Open

jcarterbohan wants to merge 1 commit into
taskcluster:mainfrom
jcarterbohan:decision-artifact-directory

Conversation

@jcarterbohan

Copy link
Copy Markdown

Add an optional artifact_dir argument to the artifact read, write, and rename helpers so callers can choose where artifacts are stored. The default is artifacts/. This also fixes YAML reads from relative directories.

This is part of the effort to merge decision task logic between standalone Taskgraph and Gecko.

Tested locally with 31 decision and action tests. Ruff passed.

@jcarterbohan
jcarterbohan requested a review from a team as a code owner November 19, 2026 22:39
@jcarterbohan
jcarterbohan requested a review from hneiva November 19, 2026 22:39

@bhearsum bhearsum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have some context as to the motivation behind adding this? Is there an open issue or bug that this is related to? I'm not seeing any way for this to get used, unless there's callers outside of taskgraph that specifically use these functions, and I'm not aware of any.

(It's not necessarily a bad change, but I'd also prefer not to add new code that has no known use case...)

@jcarterbohan

Copy link
Copy Markdown
Author

My bad for not giving more detail on this. I’m working on a Gecko patch for bug 1935412 to reuse standalone Taskgraph’s decision helpers.

The first Gecko caller would be combine_task_graph_files(), which reads and renames action artifacts like task-graph-0.json. It currently uses Gecko’s own helpers, which honor MOZ_UPLOAD_DIR.

Firefox CI already symlinks artifacts/ to its upload directory. Passing the path explicitly preserves Gecko’s existing behavior when MOZ_UPLOAD_DIR points somewhere else. I tested the Gecko read and rename changes locally against this PR with a custom MOZ_UPLOAD_DIR.

@bhearsum bhearsum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explainer! One small thing to change, but otherwise looks good to me.

Comment thread src/taskgraph/decision.py
if not os.path.isdir(ARTIFACTS_DIR):
os.mkdir(ARTIFACTS_DIR)
path = ARTIFACTS_DIR / filename
directory = ARTIFACTS_DIR if artifact_dir is None else Path(artifact_dir)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have artifact_dir passed in as a Path rather than converted here; that way both of the possible sources of it are consistent.

(And please do the same for the other functions.)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants