magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

adds NGFW support for google_network_security_tls_inspection_policy resource

Open maxi-cit opened this issue 1 year ago • 21 comments

Part of: https://github.com/hashicorp/terraform-provider-google/issues/15779

Adds support for NGFW, CA pools, Trust Configs and associated metadata

If this PR is for Terraform, I acknowledge that I have:

  • [x] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • [x] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • [x] Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • [x] Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • [x] Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

network-security: added `trust_config`, `min_tls_version`, `tls_feature_profile` and `custom_tls_features` fields to `google_network_security_tls_inspection_policy` resource

maxi-cit avatar Jan 23 '24 18:01 maxi-cit

Hello! I am a robot. It looks like you are a: Community Contributor ~Googler~ ~Core Contributor~. Tests will require approval to run.

@NickElliot, 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 avatar Jan 23 '24 18:01 modular-magician

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.

Terraform GA: Diff ( 1 file changed, 20 insertions(+)) Terraform Beta: Diff ( 2 files changed, 152 insertions(+)) TF Conversion: Diff ( 1 file changed, 40 insertions(+))

Missing test report

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

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

resource "google_network_security_server_tls_policy" "primary" {
  custom_tls_features = # value needed
  min_mtls_version    = # value needed
  tls_feature_profile = # value needed
  trust_config        = # value needed
}

modular-magician avatar Jan 23 '24 23:01 modular-magician

Tests analytics

Total tests: 32 Passed tests 27 Skipped tests: 0 Affected tests: 5

Click here to see the affected service packages
  • networksecurity

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
TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyBasicExample|TestAccNetworkSecurityServerTlsPolicy_update|TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyServerCertExample|TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyAdvancedExample|TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyMtlsExample

Get to know how VCR tests work

modular-magician avatar Jan 23 '24 23:01 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyBasicExample[Error message] [Debug log] TestAccNetworkSecurityServerTlsPolicy_update[Error message] [Debug log] TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyServerCertExample[Error message] [Debug log] TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyAdvancedExample[Error message] [Debug log] TestAccNetworkSecurityServerTlsPolicy_networkSecurityServerTlsPolicyMtlsExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jan 23 '24 23:01 modular-magician

Hello I am working on a few tests for these but I got delayed because I needed this to be merged first

maxi-cit avatar Mar 25 '24 08:03 maxi-cit

/gcbrun

NickElliot avatar Apr 03 '24 21:04 NickElliot

@maxi-cit Sorry, there's an issue in our CI. Would you mind rebasing your PR to catch the latest fix? Thank you!

shuyama1 avatar Apr 03 '24 21:04 shuyama1

/gcbrun

NickElliot avatar Apr 08 '24 16:04 NickElliot

/gcbrun

NickElliot avatar Apr 09 '24 21:04 NickElliot

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 ( 1 file changed, 20 insertions(+)) google-beta provider: Diff ( 2 files changed, 153 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 40 insertions(+))

Missing test report

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

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

resource "google_network_security_tls_inspection_policy" "primary" {
  custom_tls_features = # value needed
  min_tls_version     = # value needed
  tls_feature_profile = # value needed
  trust_config        = # value needed
}

modular-magician avatar Apr 09 '24 22:04 modular-magician

Tests analytics

Total tests: 37 Passed tests: 33 Skipped tests: 1 Affected tests: 3

Click here to see the affected service packages
  • networksecurity

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
TestAccNetworkSecurityGatewaySecurityPolicy_networkSecurityGatewaySecurityPolicyTlsInspectionBasicExample|TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyBasicExample|TestAccNetworkSecurityTlsInspectionPolicy_update

Get to know how VCR tests work

modular-magician avatar Apr 09 '24 22:04 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccNetworkSecurityGatewaySecurityPolicy_networkSecurityGatewaySecurityPolicyTlsInspectionBasicExample[Error message] [Debug log] TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyBasicExample[Error message] [Debug log] TestAccNetworkSecurityTlsInspectionPolicy_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Apr 09 '24 22:04 modular-magician

Hello @NickElliot could you run the tests please?

maxi-cit avatar Apr 19 '24 12:04 maxi-cit

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 ( 1 file changed, 53 insertions(+)) google-beta provider: Diff ( 3 files changed, 222 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 40 insertions(+))

modular-magician avatar Apr 19 '24 17:04 modular-magician

Tests analytics

Total tests: 37 Passed tests: 35 Skipped tests: 1 Affected tests: 1

Click here to see the affected service packages
  • networksecurity

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
TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyBasicExample

Get to know how VCR tests work

modular-magician avatar Apr 19 '24 17:04 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyBasicExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Apr 19 '24 17:04 modular-magician

Hello @NickElliot I updated the PR based on your suggestions. So, I added a separate example to test these new fields. However The test should be failing because of a projectId/Number issue regarding the trust_config field.

|       ~ trust_config          = "projects/29670186149/locations/us-central1/trustConfigs/tf-test-my-trust-configppxkl6y7pl" -> "projects/prj-cfio-mp-test008-svc-ext/locations/us-central1/trustConfigs/tf-test-my-trust-configppxkl6y7pl"

I already reported and they told me they are fixing it soon. Once its fixed tests should be passing

maxi-cit avatar Apr 26 '24 17:04 maxi-cit

Hello @NickElliot, could you run the tests please?

maxi-cit avatar Apr 29 '24 14:04 maxi-cit

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 ( 1 file changed, 160 insertions(+)) google-beta provider: Diff ( 3 files changed, 456 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 40 insertions(+))

modular-magician avatar Apr 29 '24 21:04 modular-magician

Tests analytics

Total tests: 38 Passed tests: 36 Skipped tests: 1 Affected tests: 1

Click here to see the affected service packages
  • networksecurity

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
TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyCustomExample

Get to know how VCR tests work

modular-magician avatar Apr 29 '24 21:04 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyCustomExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Apr 29 '24 21:04 modular-magician

Hello @NickElliot, I missed adding the datasource for project. now it should be fine.

maxi-cit avatar Apr 30 '24 16:04 maxi-cit

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 ( 1 file changed, 164 insertions(+)) google-beta provider: Diff ( 3 files changed, 464 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 40 insertions(+))

modular-magician avatar May 01 '24 20:05 modular-magician

Tests analytics

Total tests: 38 Passed tests: 36 Skipped tests: 1 Affected tests: 1

Click here to see the affected service packages
  • networksecurity

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
TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyCustomExample

Get to know how VCR tests work

modular-magician avatar May 01 '24 20:05 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyCustomExample[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

modular-magician avatar May 01 '24 20:05 modular-magician

Hello @NickElliot, I added most of the suggestions. Could you give it a new round of review please?

maxi-cit avatar May 06 '24 21:05 maxi-cit

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 ( 2 files changed, 295 insertions(+)) google-beta provider: Diff ( 3 files changed, 457 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 40 insertions(+))

modular-magician avatar May 08 '24 22:05 modular-magician

Tests analytics

Total tests: 38 Passed tests: 36 Skipped tests: 1 Affected tests: 1

Click here to see the affected service packages
  • networksecurity

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
TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyCustomExample

Get to know how VCR tests work

modular-magician avatar May 08 '24 22:05 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccNetworkSecurityTlsInspectionPolicy_networkSecurityTlsInspectionPolicyCustomExample[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

modular-magician avatar May 08 '24 22:05 modular-magician

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 ( 2 files changed, 295 insertions(+)) google-beta provider: Diff ( 3 files changed, 457 insertions(+)) terraform-google-conversion: Diff ( 1 file changed, 40 insertions(+))

modular-magician avatar May 10 '24 21:05 modular-magician