Skip to content

Made nested query resources replace the whole resource instead of merging new over old #13234

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

Conversation

melinath
Copy link
Member

@melinath melinath commented Feb 28, 2025

This allows fields to be unset using the same logic that any other field on any other resource would use.

Related to hashicorp/terraform-provider-google#14848

b/394945456#comment14

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: fixed bug in `google_compute_router_nat` where `max_ports_per_vm` couldn't be unset once set.

Note: Technically this also allows nat_ip_allocate_option to be unset, but that field must be set for type = PUBLIC and can't be set for type = PRIVATE, and modifying type forces recreation, so there doesn't seem to be a case where it can actually be unset on update.

This doesn't impact google_compute_router_nat because the only optional field has send_empty_value set.

…ging new over old

This allows fields to be unset using the same logic that any other field on any other resource would use.
@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeRouterNatAddress_withAddressCountDecrease [Error message] [Debug log]
TestAccComputeRouterNatAddress_withNatIpsAndDrainNatIps [Error message] [Debug log]
TestAccComputeRouterNat_withPrivateNatAndRules [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 72 insertions(+), 110 deletions(-))
google-beta provider: Diff ( 3 files changed, 72 insertions(+), 110 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1123
Passed tests: 1040
Skipped tests: 79
Affected tests: 4

Click here to see the affected service packages
  • compute

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeRouterNatAddress_withAddressCountDecrease
  • TestAccComputeRouterNatAddress_withNatIpsAndDrainNatIps
  • TestAccComputeRouterNat_update
  • TestAccComputeRouterNat_withPrivateNatAndRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeRouterNat_update [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeRouterNatAddress_withAddressCountDecrease [Error message] [Debug log]
TestAccComputeRouterNatAddress_withNatIpsAndDrainNatIps [Error message] [Debug log]
TestAccComputeRouterNat_withPrivateNatAndRules [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

})
}

func TestAccComputeRouterNat_removeLogConfig(t *testing.T) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now covered by the main update test.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 111 insertions(+), 110 deletions(-))
google-beta provider: Diff ( 3 files changed, 112 insertions(+), 110 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1123
Passed tests: 1043
Skipped tests: 79
Affected tests: 1

Click here to see the affected service packages
  • compute

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeRouterNat_withPrivateNatAndRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeRouterNat_withPrivateNatAndRules [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 77 insertions(+), 108 deletions(-))
google-beta provider: Diff ( 3 files changed, 78 insertions(+), 108 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1123
Passed tests: 1038
Skipped tests: 79
Affected tests: 6

Click here to see the affected service packages
  • compute

Action taken

Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeRouterNat_update
  • TestAccComputeRouterNat_withAddressCountDecrease
  • TestAccComputeRouterNat_withNatIpsAndDrainNatIps
  • TestAccComputeRouterNat_withNatRules
  • TestAccComputeRouterNat_withPortAllocationMethods
  • TestAccComputeRouterNat_withPrivateNatAndRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeRouterNat_update [Debug log]
TestAccComputeRouterNat_withAddressCountDecrease [Debug log]
TestAccComputeRouterNat_withNatIpsAndDrainNatIps [Debug log]
TestAccComputeRouterNat_withNatRules [Debug log]
TestAccComputeRouterNat_withPortAllocationMethods [Debug log]
TestAccComputeRouterNat_withPrivateNatAndRules [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@melinath
Copy link
Member Author

melinath commented Mar 3, 2025

@modular-magician reassign-reviewer

Copy link

github-actions bot commented Mar 3, 2025

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@roaks3, 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.

@github-actions github-actions bot requested a review from roaks3 March 3, 2025 18:57
Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@melinath melinath added this pull request to the merge queue Mar 5, 2025
Merged via the queue into GoogleCloudPlatform:main with commit 2ba1acd Mar 5, 2025
21 checks passed
@melinath melinath deleted the fix-unsetting-nested-query-resource-fields branch March 5, 2025 21:52
NA2047 pushed a commit to NA2047/magic-modules that referenced this pull request Mar 13, 2025
yerniyazN pushed a commit to yerniyazN/magic-modules that referenced this pull request Mar 17, 2025
JaylonmcShan03 pushed a commit to JaylonmcShan03/magic-modules-jmcshan that referenced this pull request Mar 25, 2025
JaylonmcShan03 pushed a commit to JaylonmcShan03/magic-modules-jmcshan that referenced this pull request Mar 30, 2025
Dawid212 pushed a commit to Dawid212/magic-modules that referenced this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants