-
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
google_storage_bucket
: fix custom_placement_config
values not normalized
#10936
google_storage_bucket
: fix custom_placement_config
values not normalized
#10936
Conversation
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccStorageBucket_dualLocation_lowercase |
|
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.
Could you avoid StateFunc and its limitations by making the flattener function downcase all strings before they're stored in state?
this would work for when the user inputs lowercase values but if users set as all caps they'll get diffs since state is set to |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: Click here to see the affected service packages
Non-exercised testsTests were added that are skipped in VCR:
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: Click here to see the affected service packages
Non-exercised testsTests were added that are skipped in VCR:
|
@roaks3 hi! let me know if there's anything else needed for this review 👍🏼 |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: Click here to see the affected service packages
Non-exercised testsTests were added that are skipped in VCR:
|
@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
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.
For the most part, this seems reasonable, and looks like it's working to me. But it is a bit unusual, so I'd like to understand the solution a bit better if possible:
- I'm not quite understanding the trick to filter for uppercased values in the expander. Could you explain how it is working? It seems to handle the migration between provider versions well, but are there other types of changes to the config that might cause an issue?
- Probably naive, but I can't help but wonder why a diff suppress doesn't work instead. It seems like the API accepts lower or uppercase, and returns uppercase?
Normally The added logic filters the list that
For the most part I wasn't able to come up with other configs that could potentially cause issues with this. It handles lowercase and uppercase list configs well. Let me know if there's still something in my explanation that wasn't clear with this approach. I agree that the solution is unusual and comes from needing to workaround the limitations of
Look into implementing a workaround for using it on Sets but not coming across a solution yet, I can spend more time it next week but that's the main reason why |
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.
Ah ok, thanks for explaining, that all makes sense. I personally don't think it requires more investigation into using DiffSuppressFunc
, but it might be worth adding a comment or two so the reader of the code knows why this works.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: Click here to see the affected service packages
Non-exercised testsTests were added that are skipped in VCR:
|
Resolves hashicorp/terraform-provider-google#18035
Solution was to use
StateFunc
which converts the values indata_locations
to be set as uppercase before storing into state. However as stated in the linked issue, there's a known problem with SDK that when usingStateFunc
in a nested attribute such astype.Set
it will add the new value instead of replacing.But by ignoring values in
data_locations
when expanding that aren't all capitalized, we can ensure that the final state will only include what we specified inStateFunc
test output:
TestAccStorageBucket_dualLocation_lowercase
- newly added testTestAccStorageBucket_dualLocation_versionChange
- newly added test to ensure that behavior for user doesn't change:TestAccStorageBucket_dualLocation
:Release Note Template for Downstream PRs (will be copied)