Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] BREAKING CHANGE: Change get_config_dir to honor XDG spec #30668

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

HStry
Copy link

@HStry HStry commented Jan 16, 2025

Description

This commit modifies the get_config_dir function to honor the XDG Base Directory Specification in accordance with https://specifications.freedesktop.org/basedir-spec/latest/, and falls back to a dot-dir in the user's home directory if the relevant environment variables and home directories do not exist.

Testing Guide

On running the az cli, it should now refer to '${XDG_CONFIG_HOME}/azure', or '${HOME}/.config/azure'.

This checklist is used to make sure that common guidelines for a pull request are followed.

This commit modifies the `get_config_dir` function to honor the XDG Base Directory Specification in accordance with https://specifications.freedesktop.org/basedir-spec/latest/, and falls back to a dot-dir in the user's home directory if the relevant environment variables and home directories do not exist.
Copy link

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 16, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Core CLI core infrastructure labels Jan 16, 2025
@HStry
Copy link
Author

HStry commented Jan 16, 2025

@microsoft-github-policy-service agree

@bebound
Copy link
Contributor

bebound commented Jan 17, 2025

This is a devastating breaking change.

@HStry
Copy link
Author

HStry commented Jan 17, 2025

This is a devastating breaking change.

Yesterday, I indeed found out that it still made the ~/.azure directory after adding this change to my local setup, so yes, as it is, this is definitely breaking.
However it should not be. The XDG spec exists, is backwards compatible, and has been adopted by pretty much all distributions, for a reason. It's rather sad that large projects like Azure appear not to follow it, but I'd need a much longer time to figure out all the locations where this application/module has hard-coded the ~/.azure directory in order to adapt this.

And maybe for backwards-compatibility and consistency, have the first version check if the ~/.azure directory exists, and if so, use that regardless of what the XDG_CONFIG_HOME variable says.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Core CLI core infrastructure customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants