-
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
Fix issue with google_compute_(region_)per_instance_config.stateful.ips.ipAddress.address always having diff due to relative vs full path #12056
base: main
Are you sure you want to change the base?
Conversation
…ps.ipAddress.address always having diff due to relative vs full path
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @shuyama1, 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: 1036 Click here to see the affected service packages
Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
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: 1036 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 tests
|
@shuyama1 is this considered a breaking change? Since we had to modify tests I would imagine it is, but please share your take on this :) |
@shuyama1 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.
@shuyama1 is this considered a breaking change? Since we had to modify tests I would imagine it is, but please share your take on this :)
Thanks for making the change. Let me confirm if I understand the case correctly -
-
Before the change:
we can send both full and relative path to the API, but since the API only returns the full URL, we'll run into permadiffs for cases where relative path is specified. -
After the change:
Since we add a custom flattener, it will always write the relative path to the state, which will result in permadiff for cases where full path is specified.
If I understand the case correctly, yes, this change will break current configs. We'll need to find a solution ensure that sending either full or relative path should result in no permadiffs in Terraform. I'm thinking that adding a diff suppress function might be working in this situation, likely you can use the existing function CompareSelfLinkRelativePaths
Please let me know if you have any questions.
@askubis, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
@askubis, this PR is waiting for action from you. If no action is taken, this PR will be closed in 14 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
@askubis, this PR is waiting for action from you. If no action is taken, this PR will be closed in 2 weekdays. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
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.
|
I think I need some help with that change.
` any idea what could I be doing wrong here? |
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: 4328 Click here to see the affected service packages
Action takenFound 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
1 similar comment
Tests analyticsTotal tests: 4328 Click here to see the affected service packages
Action takenFound 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @shuyama1 This PR has been waiting for review for 1 week. 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.
I think I need some help with that change. I modified the tests first - both .self_link and .id should work (because why not, one is the current state, the other is what we recommend in the documentation) I did what was recommended - added the diff_supress_func. I even added tests to it, so that it would be clear that it does what expected ( "partial path, same": { Old: "googleapis.com/compute/v1/projects/your-project/global/networks/a-network", New: "projects/your-project/global/networks/a-network", Expect: true, },) And yet, still we have the same diff when running the test. ` - internal_ip { - auto_delete = "NEVER" -> null - interface_name = "nic0" -> null
- ip_address { - address = "https://www.googleapis.com/compute/v1/projects/REDACTED/regions/us-central1/addresses/tf-test-rigm-address97pzzqv6th" -> null } } + internal_ip { + auto_delete = "NEVER" + interface_name = "nic0" + ip_address { + address = "projects/REDACTED/regions/us-central1/addresses/tf-test-rigm-address97pzzqv6th" } }
`
any idea what could I be doing wrong here?
Okay, I’ve looked into this issue a bit and found that the DSF not working is likely due to a known problem with the SDK hashicorp/terraform-plugin-sdk#477. It seems we may need to write a custom DSF for its parent set field. I’m trying out some solutions locally and will share updates as I progress.
@askubis, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @shuyama1 This PR has been waiting for review for 1 week. Please take a look! Use the label |
Convert the full path to
fixes hashicorp/terraform-provider-google#19265
Release Note Template for Downstream PRs (will be copied)