Skip to content
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

Added new resource "Router Nat Address" #11390

Conversation

matheusaleixo-cit
Copy link
Contributor

@matheusaleixo-cit matheusaleixo-cit commented Aug 7, 2024

Adds new resource google_compute_router_nat_address, allowing changes to the nat_ips and drain_nat_ips fields separately from the google_compute_router_nat resource.

Also adds a new field initial_nat_ip for resource google_compute_router_nat as well, to be used for the required address during creation.

Part of: hashicorp/terraform-provider-google#6812

Release Note Template for Downstream PRs (will be copied)

`google_compute_router_nat_address`
compute: added 'initial_nat_ip' field to 'google_compute_router_nat' resource, to enable use of the fine-grained resource `google_compute_router_nat_address`

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 7, 2024
@modular-magician modular-magician added service/compute-nat and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Aug 8, 2024
@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 ( 6 files changed, 1157 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 1157 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • compute
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccComputeRouterNatAddress_withAddressCountDecrease
  • TestAccComputeRouterNat_withAddressCountDecrease
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 12, 2024
- Added diff suppress for natIps when using initialNatIps;
- Added RouterNatAddress example and handwritten Test DestroyProducer function;
@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 15, 2024
@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Aug 15, 2024
@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 ( 8 files changed, 1315 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 8 files changed, 1315 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 983
Passed tests: 893
Skipped tests: 72
Affected tests: 18

Click here to see the affected service packages
  • compute

Action taken

Found 18 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeDisk_storagePoolSpecified
  • TestAccComputeInstance_bootDisk_storagePoolSpecified
  • TestAccComputeRouterNatAddress_withAddressCountDecrease
  • TestAccComputeRouterNat_AutoNetworkTier
  • TestAccComputeRouterNat_basic
  • TestAccComputeRouterNat_removeLogConfig
  • TestAccComputeRouterNat_update
  • TestAccComputeRouterNat_withAddressCountDecrease
  • TestAccComputeRouterNat_withEndpointTypes
  • TestAccComputeRouterNat_withManualIpAndSubnetConfiguration
  • TestAccComputeRouterNat_withNatIpsAndDrainNatIps
  • TestAccComputeRouterNat_withNatRules
  • TestAccComputeRouterNat_withPortAllocationMethods
  • TestAccComputeRouterNat_withPrivateNat
  • TestAccComputeRouterNat_withPrivateNatAndEmptyAction
  • TestAccComputeRouterNat_withPrivateNatAndEmptyActionActiveRanges
  • TestAccComputeRouterNat_withPrivateNatAndRules
  • TestAccDataSourceGoogleComputeRouterNat_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRouterNat_AutoNetworkTier[Debug log]
TestAccComputeRouterNat_basic[Debug log]
TestAccComputeRouterNat_removeLogConfig[Debug log]
TestAccComputeRouterNat_update[Debug log]
TestAccComputeRouterNat_withEndpointTypes[Debug log]
TestAccComputeRouterNat_withManualIpAndSubnetConfiguration[Debug log]
TestAccComputeRouterNat_withNatIpsAndDrainNatIps[Debug log]
TestAccComputeRouterNat_withNatRules[Debug log]
TestAccComputeRouterNat_withPortAllocationMethods[Debug log]
TestAccComputeRouterNat_withPrivateNat[Debug log]
TestAccComputeRouterNat_withPrivateNatAndEmptyAction[Debug log]
TestAccComputeRouterNat_withPrivateNatAndEmptyActionActiveRanges[Debug log]
TestAccComputeRouterNat_withPrivateNatAndRules[Debug log]
TestAccDataSourceGoogleComputeRouterNat_basic[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeDisk_storagePoolSpecified[Error message] [Debug log]
TestAccComputeInstance_bootDisk_storagePoolSpecified[Error message] [Debug log]
TestAccComputeRouterNatAddress_withAddressCountDecrease[Error message] [Debug log]
TestAccComputeRouterNat_withAddressCountDecrease[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

- Added DiffSuppressFunction to drainNatIps in RouterNat for when initialNatIps is used;
- Fixed issues with RouterNatAddress id_format;
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 19, 2024
@matheusaleixo-cit matheusaleixo-cit marked this pull request as ready for review August 26, 2024 20:54
Copy link

@SarahFrench This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 16, 2024
@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 ( 7 files changed, 1600 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1600 insertions(+), 2 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_router_nat (27 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat" "primary" {
  drain_nat_ips = # value needed
}

Resource: google_compute_router_nat_address (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat_address" "primary" {
  drain_nat_ips = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1007
Passed tests: 927
Skipped tests: 75
Affected tests: 5

Click here to see the affected service packages
  • compute

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstance_confidentialHyperDiskBootDisk
  • TestAccComputeRouterNatAddress_withAddressCountDecrease
  • TestAccComputeRouterNatAddress_withAddressRemoved
  • TestAccComputeRouterNatAddress_withNatIpsAndDrainNatIps
  • TestAccComputeRouterNat_withAddressCountDecrease

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInstance_confidentialHyperDiskBootDisk[Debug log]
TestAccComputeRouterNatAddress_withAddressCountDecrease[Debug log]
TestAccComputeRouterNatAddress_withAddressRemoved[Debug log]
TestAccComputeRouterNatAddress_withNatIpsAndDrainNatIps[Debug log]
TestAccComputeRouterNat_withAddressCountDecrease[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

Copy link

@GoogleCloudPlatform/terraform-team @SarahFrench This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

@SarahFrench
Copy link
Collaborator

👋 Sorry, I've had a few days off on sick leave. Taking a look at the PR now!

Copy link
Collaborator

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Left a comment here about the need for a new acceptance test to help us decide between diff suppress funcs and using default_from_api when implementing these changes

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 19, 2024
@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 ( 7 files changed, 1669 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 7 files changed, 1669 insertions(+), 2 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_router_nat (27 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat" "primary" {
  drain_nat_ips = # value needed
}

Resource: google_compute_router_nat_address (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat_address" "primary" {
  drain_nat_ips = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1011
Passed tests: 936
Skipped tests: 74
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
  • TestAccComputeRouterNatAddress_withAutoAllocateAndAddressRemoved

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRouterNatAddress_withAutoAllocateAndAddressRemoved[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@SarahFrench
Copy link
Collaborator

Thanks! The new test passing shows that users can still change those fields when their use case changes, and from looking at the test debug logs I can see the same resource is being updated (versus being recreated). Given this I'm happy to approve

@SarahFrench SarahFrench merged commit c7be32c into GoogleCloudPlatform:main Sep 20, 2024
15 checks passed
abd-goog pushed a commit to abd-goog/magic-modules that referenced this pull request Sep 23, 2024
@matheusaleixo-cit matheusaleixo-cit deleted the fix-cannot-delete-compute-address-when-its-dependency-of-compute-router-nat branch October 2, 2024 21:33
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Oct 7, 2024
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.

5 participants