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

Migrate Network Firewall Policy Rule (global and region) from DCL to MMv1 #11368

Merged

Conversation

Samir-Cit
Copy link
Contributor

@Samir-Cit Samir-Cit commented Aug 6, 2024

Hello folks.

This PR is to move two Network Firewall Policy Rule resources (global and region) from DCL to MMv1.

  • google_compute_network_firewall_policy_rule
  • google_compute_region_network_firewall_policy_rule

And this PR includes:

  • Creation of the resource on MMv1.
  • Creation of the examples and tests.
  • Remove references to DCL resource.

Note: This PR doesn't include the actual deletion of the DCL resource.

Related to hashicorp/terraform-provider-google#18134

Release Note Template for Downstream PRs (will be copied)

compute: `google_compute_network_firewall_policy_rule` now uses MMv1 engine instead of DCL.
compute: `google_compute_region_network_firewall_policy_rule` now uses MMv1 engine instead of DCL.

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 6, 2024
@Samir-Cit Samir-Cit changed the title Move google_compute_network_firewall_policy_rule resource from DCL to MMv1 Move Network Firewall Policy Rule (global and region) resource from DCL to MMv1 Aug 6, 2024
@Samir-Cit Samir-Cit marked this pull request as ready for review August 9, 2024 22:18
@github-actions github-actions bot requested a review from ScottSuarez August 9, 2024 22:19
Copy link

github-actions bot commented Aug 9, 2024

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

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

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 12, 2024
@ScottSuarez ScottSuarez requested review from slevenick and trodge and removed request for ScottSuarez August 12, 2024 21:56
@trodge trodge self-assigned this Aug 12, 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 ( 10 files changed, 2486 insertions(+), 1615 deletions(-))
google-beta provider: Diff ( 10 files changed, 2486 insertions(+), 1615 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 856 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field kind within resource google_compute_network_firewall_policy_rule was either removed or renamed - reference
  • Field kind within resource google_compute_region_network_firewall_policy_rule was either removed or renamed - reference
  • Field match.src_secure_tags.name lost its diff suppress function - reference
  • Field project lost its diff suppress function - reference
  • Field region transitioned from optional+computed to optional google_compute_region_network_firewall_policy_rule - reference
  • Field target_secure_tags.name lost its diff suppress function - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

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

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

resource "google_compute_network_firewall_policy_rule" "primary" {
  target_resources = # value needed
  target_secure_tags {
    name = # value needed
  }
  tls_inspect = # value needed
}

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

resource "google_compute_region_network_firewall_policy_rule" "primary" {
  match {
    dest_address_groups       = # value needed
    dest_fqdns                = # value needed
    dest_ip_ranges            = # value needed
    dest_region_codes         = # value needed
    dest_threat_intelligences = # value needed
    layer4_configs {
      ports = # value needed
    }
  }
  security_profile_group = # value needed
  target_resources       = # value needed
  target_secure_tags {
    name = # value needed
  }
  tls_inspect = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 979
Passed tests: 901
Skipped tests: 72
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
  • TestAccComputeInstance_bootDisk_storagePoolSpecified
  • TestAccComputeNetworkFirewallPolicyRule_multipleRules
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleExample
  • TestAccComputeNetworkFirewallPolicyRule_securityProfileGroup_update
  • TestAccComputeNetworkFirewallPolicyRule_update
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

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


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeNetworkFirewallPolicyRule_multipleRules[Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_securityProfileGroup_update[Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_update[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

@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 13, 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 ( 9 files changed, 2353 insertions(+), 1624 deletions(-))
google-beta provider: Diff ( 9 files changed, 2353 insertions(+), 1624 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 866 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field kind within resource google_compute_network_firewall_policy_rule was either removed or renamed - reference
  • Field kind within resource google_compute_region_network_firewall_policy_rule was either removed or renamed - reference
  • Field project lost its diff suppress function - reference
  • Field project transitioned from optional+computed to optional google_compute_network_firewall_policy_rule - reference
  • Field region transitioned from optional+computed to optional google_compute_region_network_firewall_policy_rule - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

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

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

resource "google_compute_network_firewall_policy_rule" "primary" {
  target_resources = # value needed
  target_secure_tags {
    name = # value needed
  }
  tls_inspect = # value needed
}

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

resource "google_compute_region_network_firewall_policy_rule" "primary" {
  match {
    dest_address_groups       = # value needed
    dest_fqdns                = # value needed
    dest_ip_ranges            = # value needed
    dest_region_codes         = # value needed
    dest_threat_intelligences = # value needed
    layer4_configs {
      ports = # value needed
    }
  }
  security_profile_group = # value needed
  target_resources       = # value needed
  target_secure_tags {
    name = # value needed
  }
  tls_inspect = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 980
Passed tests: 904
Skipped tests: 72
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
  • TestAccComputeNetworkFirewallPolicyRule_multipleRules
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleExample
  • TestAccComputeNetworkFirewallPolicyRule_securityProfileGroup_update
  • TestAccComputeNetworkFirewallPolicyRule_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

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


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleExample[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

@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 14, 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 ( 9 files changed, 2355 insertions(+), 1626 deletions(-))
google-beta provider: Diff ( 9 files changed, 2355 insertions(+), 1626 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 866 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field kind within resource google_compute_network_firewall_policy_rule was either removed or renamed - reference
  • Field kind within resource google_compute_region_network_firewall_policy_rule was either removed or renamed - reference
  • Field project lost its diff suppress function - reference
  • Field project transitioned from optional+computed to optional google_compute_network_firewall_policy_rule - reference
  • Field region transitioned from optional+computed to optional google_compute_region_network_firewall_policy_rule - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

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

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

resource "google_compute_network_firewall_policy_rule" "primary" {
  target_resources = # value needed
  target_secure_tags {
    name = # value needed
  }
  tls_inspect = # value needed
}

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

resource "google_compute_region_network_firewall_policy_rule" "primary" {
  match {
    dest_address_groups       = # value needed
    dest_fqdns                = # value needed
    dest_ip_ranges            = # value needed
    dest_region_codes         = # value needed
    dest_threat_intelligences = # value needed
    layer4_configs {
      ports = # value needed
    }
  }
  security_profile_group = # value needed
  target_resources       = # value needed
  target_secure_tags {
    name = # value needed
  }
  tls_inspect = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 981
Passed tests: 909
Skipped tests: 72
Affected tests: 0

Click here to see the affected service packages
  • compute

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

View the build log

Copy link

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

@trodge
Copy link
Contributor

trodge commented Aug 15, 2024

This looks to me like you're on the right track, but I'd like us to improve the test coverage to make sure the migration works as expected.

All of the detected breaking changes will need to be addressed by adding support for emulating the DCL behaviors in MMv1, usually through custom_code additions.

Here are some examples of PRs showing how that process can work:

#10759
#11052
#11066
#10527

Copy link
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

@github-actions github-actions bot requested a review from trodge August 16, 2024 15:15
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 16, 2024
@Samir-Cit
Copy link
Contributor Author

Samir-Cit commented Aug 16, 2024

This looks to me like you're on the right track, but I'd like us to improve the test coverage to make sure the migration works as expected.

All of the detected breaking changes will need to be addressed by adding support for emulating the DCL behaviors in MMv1, usually through custom_code additions.

Here are some examples of PRs showing how that process can work:

#10759 #11052 #11066 #10527

Hello @trodge , I just saw both your comments.
Thanks for the examples, it will help me a lot!
I'll take a look and apply what fits on my development and also create new test scenarios to improve the coverage.

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeNetworkFirewallPolicyRule_multipleRules[Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleExample[Debug log]
TestAccComputeNetworkFirewallPolicyRule_secureTags[Debug log]
TestAccComputeNetworkFirewallPolicyRule_securityProfileGroup_update[Debug log]
TestAccComputeNetworkFirewallPolicyRule_update[Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_multipleRules[Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleExample[Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_secureTags[Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_update[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

@trodge trodge added the override-breaking-change Allows a potential breaking change to be merged label Oct 10, 2024
@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 Oct 10, 2024
@trodge trodge dismissed stale reviews from slevenick and themself October 10, 2024 22:36

stale

@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 ( 12 files changed, 3579 insertions(+), 1556 deletions(-))
google-beta provider: Diff ( 12 files changed, 3579 insertions(+), 1556 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 836 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field project lost its diff suppress function - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

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

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

resource "google_compute_region_network_firewall_policy_rule" "primary" {
  security_profile_group = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1032
Passed tests: 956
Skipped tests: 73
Affected tests: 3

Click here to see the affected service packages
  • compute

Action taken

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeRegionNetworkFirewallPolicyRule_multipleRules[Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_secureTags[Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_update[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 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 Oct 11, 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 ( 12 files changed, 3579 insertions(+), 1556 deletions(-))
google-beta provider: Diff ( 12 files changed, 3579 insertions(+), 1556 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 836 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field project lost its diff suppress function - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

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

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

resource "google_compute_region_network_firewall_policy_rule" "primary" {
  security_profile_group = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1032
Passed tests: 958
Skipped tests: 73
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
  • TestAccComputeRegionNetworkFirewallPolicyRule_secureTags

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeRegionNetworkFirewallPolicyRule_secureTags[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

Copy link

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

@trodge trodge merged commit dfda841 into GoogleCloudPlatform:main Oct 15, 2024
13 checks passed
gontech pushed a commit to gontech/magic-modules that referenced this pull request Oct 16, 2024
varshatumburu pushed a commit to varshatumburu/magic-modules that referenced this pull request Oct 19, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 23, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 24, 2024
@Samir-Cit Samir-Cit deleted the feat/NetworkFirewallPolicyRule branch November 1, 2024 16:11
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
amanMahendroo pushed a commit to amanMahendroo/magic-modules that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants