Skip to content

fix: ensure GraphConfig.root_dir is an absolute path#673

Merged
bhearsum merged 2 commits intotaskcluster:mainfrom
bhearsum:root-dir
Apr 10, 2025
Merged

fix: ensure GraphConfig.root_dir is an absolute path#673
bhearsum merged 2 commits intotaskcluster:mainfrom
bhearsum:root-dir

Conversation

@bhearsum
Copy link
Copy Markdown
Contributor

@bhearsum bhearsum commented Apr 7, 2025

No description provided.

Comment thread src/taskgraph/config.py Outdated
def load_graph_config(root_dir):
# ensure we have an absolute path; this is required for assumptions
# made later, such as the `vcs_root` being a directory above `root_dir`
root_dir = os.path.abspath(root_dir)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In theory, I think this should go in the __post_init__ method of GraphConfig. In practice, I don't think it really matters. Given GraphConfig is frozen, it would mean we'd need to use object.__setattr__ to set it, so this is probably fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah; but if there's ever anything else that creates a GraphConfig that could be a problem, I think? This seems like an easy change to make.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bhearsum
Copy link
Copy Markdown
Contributor Author

failures are codecov (meh) and pre-commit (issue on their side).

@bhearsum bhearsum merged commit df291c6 into taskcluster:main Apr 10, 2025
15 of 17 checks passed
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