-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
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.
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
Validation for Breaking Change Starting...
Thanks for your contribution! |
Thank you for your contribution! We will review the pull request and get back to you soon. |
@microsoft-github-policy-service agree |
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. 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. |
I agree with @bebound that this is a very big breaking change we cannot afford.
Azure CLI is a cross-platform tool and doesn't only work with Linux. The design is to have the same config directory location on Windows, Linux and MacOS. This behavior is also used by Azure CLI's underlying framework Knack: https://github.com/microsoft/knack/blob/b1164b57d777711fd3954cf11f18ffb06ab1ca5b/knack/cli.py#L83
We have added the config directory location to the output of
Changing the default config directory location already caused damage before: actions/runner-images#11173. |
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.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.