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

fix: assign default values to all internal variables #1518

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

hyperupcall
Copy link
Contributor

@hyperupcall hyperupcall commented Mar 26, 2023

Summary

As mentioned here, this fixes the behavior of defaulting ASDF_DEFAULT_TOOL_VERSIONS_FILENAME to the correct version. This is also done to $ASDF_DATA_DIR.

@hyperupcall hyperupcall requested a review from a team as a code owner March 26, 2023 22:43
Copy link
Contributor

@jthegedus jthegedus left a comment

Choose a reason for hiding this comment

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

LGTM

@jthegedus
Copy link
Contributor

jthegedus commented Mar 26, 2023

One assumes that the fact all our tests passed without changes that this is not a breaking change 🤔 Though it does change the behaviour of ENV VARS which are part of the "public" API so should be considered breaking 🙃

Do you consider this to be a breaking change @hyperupcall ? If this is breaking we would need to use fix!: instead of fix: for the PR title.

@jthegedus jthegedus changed the title fix: Better default internal variables fix: assign default values to all internal variables Mar 26, 2023
@hyperupcall
Copy link
Contributor Author

hyperupcall commented Mar 27, 2023

Unless I'm missing something, I don't think it's a breaking change. The environment variables are a part of the "public" API as you mention, but as far as I can tell, the behavior of the env vars isn't changing, the thing that changes is where it is set (if at all).

If asdf launches a subprocess like executing a plugin, the value of the environment variable are either the same or no longer empty, so if people were depending on a non-empty value, those values don't change. And the fix is that previous unset environment variables are now set, so that doesn't break anything. I suppose theoretically someone plugin somewhere could be relying on the fact that one or more of these variables were incorrectly unset or set, but empty - I don't personally care about that because if those were breaking changes, then too many changes would be breaking change due to Hyrum's Law and semantic versioning would be meaningless to me - intent/explicitness plays a part in my opinion.

@jthegedus
Copy link
Contributor

Thanks for the input, fix: it is then!

@jthegedus jthegedus merged commit 86477ee into asdf-vm:master Mar 27, 2023
@hyperupcall hyperupcall deleted the better-default-variables branch March 27, 2023 00:24
botp pushed a commit to botp/asdf that referenced this pull request Mar 31, 2023
fi

printf "%s\n" "$ASDF_DIR"
asdf_default_tool_versions_filename() {
Copy link
Member

@Stratus3D Stratus3D Apr 6, 2023

Choose a reason for hiding this comment

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

nitpick: The default tool versions file name is .tool-versions. If the user has customized it by setting ASDF_DEFAULT_TOOL_VERSIONS_FILENAME then this function won't return the default filename. I think asdf_tool_versions_filename would be a better function name. Sorry for the late comment, but I figured I'd bring this up just for future reference.

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.

None yet

3 participants