-
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
Fixes PermaDiff Issue in google_storage_transfer_job.aws_s3_data_source.aws_access_key
field
#12666
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @zli82016, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
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: 13 Click here to see the affected service packages
🟢 All tests passed! View the build log |
google_storage_transfer_job.aws_s3_data_source.aws_access_key
field
@zli82016 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@kautikdk , thanks for the fix. Do you mind adding a test case for this fix in this file https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/services/storagetransfer/resource_storage_transfer_job_test.go? Thanks. |
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.
Add a test
Actually we don't have tests for third party transfer service as it requires GCP setup for storing various 3p credentials. It's not done yet so the only option is manual testing as of now. |
@kautikdk , do you mind testing if the previously fixed perma diffs in #10672 are still resolved ? Thanks. |
@zli82016 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
Hi @zli82016, Shared testing logs internally. |
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.
LGTM. Thanks.
Fixes permadiff issue in
google_storage_transfer_job
resource. Ticket: b/386174536Cause: It appears that the issue is happening because of
GetOkExists
used to obtain value ofaws_s3_data_source.aws_access_key
in the flattener.GetOkExists
checks for the presence of the value regardless of zero value of the field. So here, In this case, we are always getting zero value of the fieldaws_s3_data_source.aws_access_key
which empty list,[]
, and true for it's existence even though it's not specified in the config.Solution: We can use
GetOk
to obtain value of the field from the config.GetOk
treats zero value as absent which is use case here like otherTypeList
field.Alternative: Continue using
GetOkExists
and checking empty vs unset each time,As
GetOkExists
is deprecated, reference, and discouraged to use, I preferGetOk
and didn't see any problem with that as all the nested fields withinaws_access_key
are required. So there won't be a case of empty block(without any nested field specified) and we need to separate from unset nested fields.Testing: Currently
storagetransfer
service lacks acceptance tests for third-party cloud providers so there is no way to add acceptance tests.