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

refactor: underscore variable prefix should be reserved... #65

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

gardar
Copy link
Member

@gardar gardar commented Mar 9, 2023

...for internal variables that are not user configurable

While it's not specified in any standard that I'm aware of, it's common that variables that are used internally in a role are prefixed with a underscore.

These variables were once not user configurable, so it makes sense that they were prefixed in the past, but I don't see any reason to keep them that way.

…ternal variables

Signed-off-by: gardar <gardar@users.noreply.github.com>
@gardar gardar requested a review from SuperQ March 9, 2023 18:22
@SuperQ SuperQ requested a review from paulfantom March 9, 2023 21:19
@SuperQ
Copy link
Contributor

SuperQ commented Mar 10, 2023

We had an opinion that these vars were not supposed to be used by users. They used to be internal only. @paulfantom What do you think?

@gardar
Copy link
Member Author

gardar commented Mar 10, 2023

We had an opinion that these vars were not supposed to be used by users. They used to be internal only. @paulfantom What do you think?

Then they should be placed in vars/ and not defaults/
Looking at cloudalchemy repos I see that initially they were, but then got moved to defaults to allow users to overwrite them.
With that being said, I don't see any downsides of having them overwritten by users myself.

Copy link
Member

@paulfantom paulfantom left a comment

Choose a reason for hiding this comment

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

The initial idea was to structure variables following a pattern known from python. Initially, those variables were placed in vars/. However, over time, people started using them and variables were moved into defaults/ while keeping naming to preserve compatibility. Since we now moved the role to a different place and those variables are now meant to be overridden when needed I don't see any reason to keep prefixing them with underscores.

@SuperQ SuperQ merged commit 4f02762 into prometheus-community:main Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants