-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
feat: add support for lowercased context tags #107
Conversation
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the need for the feature, but have some issues with this PR as is:
- Any new variable needs to be added:
- as a variable with default
null
- as a member of the
context
object with defaultnull
- assigned a default value (if null) in
main.tf
inlocal.defaults
and otherwise follow the pattern of precedence and pass through - be added to
context.tf
- as a variable with default
- I do not like the name of the variable
- I do not like having a boolean feature toggle for something like this where there is likely to be an explosion of options.
Brainstorming for others (especially @osterman and @aknysh) to comment on:
How about a variable like tag_format
that takes a string like "Title:none" to indicate that the tag name is transformed to Title case and the tag value is unchanged. We could then implement the current PR with tag_format = "lower:none"
and provide some other options like "UPPER" and whatever else Terraform natively supports.
yes, mostly agree with @Nuru . We're interested in the general functionality of this PR, but want to work with you get the interface right since the implications are far-reaching and involve all 130+ terraform modules we manage. We'll want to future proof it so that we can support multiple "cases" (e.g. So, I think something like what @Nuru proposes as the interface looks good. Feel free to pin us in the #pr-reviews channel on slack for real-time discussion =) |
I agree we need to be able to do it generically for many outputs ( |
@osterman I think we should start small and fill in the roadmap as demand arises. While this PR's feature is important for tags because currently we force Title Case on tag keys, generally I agree with @aknysh that the users have enough control on ID for now. @SweetOps Thanks again for your contribution. This is a lot further along, but not quite there. I think you misunderstood my proposal. The idea is that
The default format would be
(I want the formatting of the format name to reflect the format it selects, but do not want to do something crazy like I think I would implement a sub-module that takes a map ( input: {
tags: {
name: "null-label"
}
} output {
tags: {
lower: {
map_keys: { name: "name" }
map_values: { name: "null-label" }
}
Title: {
map_keys: { name: "Name" }
map_values: { name: "Null-Label" }
}
UPPER: {
map_keys: { name: "NAME" }
map_values: { name: "NULL-LABEL" }
}
}
} |
@Nuru we should not change the
|
aha, @Nuru you are suggesting the interface for the submodule. That makes sense. |
I was just about to open an issue for this, currently I can't use the tags on GCP because the keys must start with a lowercase letter. I hope this gets merged soon! |
Hello, any news/plans regarding tag name formating? |
Stepping back again, I think this is way overkill. The initial issue/request was that we allow lowercase tag names instead of forcing them to Title Case. I think we should do that (plus add a third option for UPPERCASE) and stop at that. This current PR, as I understand it, uses a tag format specifier of
and In the fully exploded feature, we would have an
But for tag values, this opens up the question of what constitutes a word boundary, since this module gets fully formed values, unlike Pascal, camel, snake, and kebab case only make sense for So I say we scale way back. Limit this PR to
with default "Title" Let's keep it simple, get it done, and get it out. Later, if there is demand, we can add a new PR with
and forming the |
Objectives
Out of Scope
Scope
|
@osterman I mostly like your revised proposal. As usual, I disagree with your choice of name, in this case As I pointed out before, I would prefer to limit As for Tags, I think we should not allow any formatting of tag values, and we should not mess with the Tag Names of any tags supplied in the As if we do not have enough to consider, this also brings up another design decision. Currently, |
@osterman Correction, GCP does force tags to start with a lowercase letter. |
Okay, I agree with the points raised by @Nuru Here's my summary for @SweetOps:
|
@osterman I left out Reflecting on it, I think we should name the variable Also, you left out defaults, which for backwards compatibility should be
If it is OK with you, I will edit your comment to incorporate these changes so it remains the reference. |
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I still think we should never alter the tag values (or keys) of tags passed in via var.tags
, I now think we should apply id_case
to the values of the generated tags, so that the values match the corresponding portion of id
. What do you think, @osterman ?
@Nuru @SweetOps: Ok, let's do some "final" =) renaming:
standard input labels:
|
Co-authored-by: Nuru <Nuru@users.noreply.github.com>
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many minor nitpicky changes, because this is a flagship module, but some substantive changes, too.
Co-authored-by: Nuru <Nuru@users.noreply.github.com>
/test all |
/test all |
/test all |
/test all |
what
why