-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use new dataflow templates, fix labels #2849
Use new dataflow templates, fix labels #2849
Conversation
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesNo diff detected in terraform-google-conversion. New Pull RequestsI built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed. |
} | ||
|
||
// If k is comparing length of maps, compare old and new value. | ||
if strings.HasPrefix(k, "labels.%") { |
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.
What's an example where we would find a diff in this section but we wouldn't have in the logic above?
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.
An example diff that would cause this:
"labels.%": 2 => 0
"labels.google-dataflow-provided-template-name": "template" => ""
"labels.google-dataflow-provided-template-version": "2019_12_01_blahblah" => ""
The first if is just a guard so we aren't looking at non-label fields - I can remove it.
Second is for the two label fields.
Third is for the number comparison - we need to know whether new-old is empty and old-new is only suppressable labels.
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.
is just checking the label prefix enough?
like,
if strings.HasPrefix(k, "labels.%") {
return true
}
and then getting rid of the other section? because then you'd return true in cases where it's the label prefix, and false in cases where it's a real diff, right?
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 believe so? There was a weird thing a long time ago where it didn't work with non-present vs empty maps, but it maybe got fixed by 0.12? I'm fine with removing it
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.
Ok! Yeah I don't really remember, but if you checked and this way works then yay less code.
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesterraform-provider-google-beta already has an open PR. New Pull RequestsI didn't open any new pull requests because of this PR. |
1 similar comment
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesterraform-provider-google-beta already has an open PR. New Pull RequestsI didn't open any new pull requests because of this PR. |
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesterraform-provider-google-beta already has an open PR. New Pull RequestsI didn't open any new pull requests because of this PR. |
} | ||
|
||
// If k is comparing length of maps, compare old and new value. | ||
if strings.HasPrefix(k, "labels.%") { |
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.
Ok! Yeah I don't really remember, but if you checked and this way works then yay less code.
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
ea980ac
to
4ed377c
Compare
Fixes hashicorp/terraform-provider-google#5046
Fixes hashicorp/terraform-provider-google#5038