Skip to content

Conversation

@matheusaleixo-cit
Copy link
Contributor

@matheusaleixo-cit matheusaleixo-cit commented Mar 12, 2025

Adds the option to manage a new profile type URL_FILTERING for networksecurity SecurityProfile and SecurityProfileGroup, adding the url_filtering_profile field and related tests to those resources.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

networksecurity: added `URL_FILTERING` option to enum field `type` for `google_network_security_security_profile` resource
networksecurity: added `url_filtering_profile` field  to `google_network_security_security_profile` resource (beta)
networksecurity: added `url_filtering_profile` field  to `google_network_security_security_profile_group` resource (beta)

… for SecurityProfile;

- Added urlFilteringProfile field to SecurityProfileGroup;
- Added default url_filters to SecurityProfile and SecurityProfileGroup tests;
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 12, 2025
@matheusaleixo-cit matheusaleixo-cit marked this pull request as ready for review September 17, 2025 20:03
@github-actions
Copy link

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

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@slevenick, 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 slevenick September 17, 2025 20:04
- 'urlFilteringProfile'
- 'customMirroringProfile'
- 'customInterceptProfile'
- name: 'urlFilteringProfile'
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add an update test for this field? Adding/deleting items in the url_filters set is the main thing to test

@github-actions github-actions bot requested a review from slevenick September 17, 2025 23:04
@modular-magician modular-magician added service/network-security-distributed-firewall and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Sep 18, 2025
@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 ( 4 files changed, 109 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 9 files changed, 644 insertions(+), 7 deletions(-))
terraform-google-conversion: Diff ( 10 files changed, 336 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 70
Passed tests: 63
Skipped tests: 4
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
  • TestAccNetworkSecuritySecurityProfileGroup_networkSecuritySecurityProfileGroupUrlFilteringExample
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringExample
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccNetworkSecuritySecurityProfileGroup_networkSecuritySecurityProfileGroupUrlFilteringExample [Error message] [Debug log]
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringExample [Error message] [Debug log]
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate [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

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Beta-only tests need provider = google-beta declared in the config

@github-actions github-actions bot requested a review from slevenick September 18, 2025 20:19
@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 ( 4 files changed, 112 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 9 files changed, 655 insertions(+), 7 deletions(-))
terraform-google-conversion: Diff ( 10 files changed, 336 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 70
Passed tests: 63
Skipped tests: 4
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
  • TestAccNetworkSecuritySecurityProfileGroup_networkSecuritySecurityProfileGroupUrlFilteringExample
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringExample
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccNetworkSecuritySecurityProfileGroup_networkSecuritySecurityProfileGroupUrlFilteringExample [Debug log]
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate [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

…ority 2147483647 cannot be updated);

- Changed update test step 2 to now update rule priority 1;
@github-actions
Copy link

@slevenick 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
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 ( 4 files changed, 112 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 9 files changed, 622 insertions(+), 7 deletions(-))
terraform-google-conversion: Diff ( 10 files changed, 336 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 70
Passed tests: 65
Skipped tests: 4
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
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate [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

@matheusaleixo-cit
Copy link
Contributor Author

I'm having problems running the tests for this resource locally (facing some ADC auth problems when creating organization level resources), can you show me the logs for the failing update test?
I imagine the default url_filter (priority 2147483647) would be causing issues.

@github-actions
Copy link

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

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Yeah it looks like the default rule is causing issues:
It fails with resource_network_security_security_profile_test.go:121: Step 1/8 error: After applying this test step, the plan was not empty.

              - url_filters {
                  - filtering_action = "DENY" -> null
                  - priority         = 2147483647 -> null
                  - urls             = [
                      - "*",
                    ] -> null
                }
            }
        }

Looks like it's getting a default profile set automatically

… auto-created url_filter;

- Removed from example tests the url_filter using default priority (2147483647) as these are currently immutable;
@github-actions github-actions bot requested a review from slevenick October 2, 2025 00:06
@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 ( 4 files changed, 102 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 9 files changed, 632 insertions(+), 7 deletions(-))
terraform-google-conversion: Diff ( 10 files changed, 365 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 71
Passed tests: 64
Skipped tests: 4
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
  • TestAccNetworkSecuritySecurityProfileGroup_networkSecuritySecurityProfileGroupUrlFilteringExample
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringExample
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccNetworkSecuritySecurityProfileGroup_networkSecuritySecurityProfileGroupUrlFilteringExample [Debug log]
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate [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


priorityFlatten := flattenNetworkSecuritySecurityProfileUrlFilteringProfileUrlFiltersPriority(original["priority"], d, config)
// Do not include the auto created default url_filter coming back from the api unless the user included it in his config
if priorityFlatten == 2147483647 && !resourceDataContainsDefaultFilter {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is causing the failure, the default priority is included in the config but we aren't seeing it in state after import:
=== CONT TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate
resource_network_security_security_profile_test.go:121: Step 8/10 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.

      map[string]string{
    - 	"url_filtering_profile.#":   "1",
    - 	"url_filtering_profile.0.%": "1",
      }

Copy link
Contributor

Choose a reason for hiding this comment

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

Or the place above where we check for this priority specifically

…ering_profile field instead of only url_filters;
@github-actions github-actions bot requested a review from slevenick October 2, 2025 17:48
@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 ( 4 files changed, 102 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 9 files changed, 632 insertions(+), 7 deletions(-))
terraform-google-conversion: Diff ( 10 files changed, 365 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 71
Passed tests: 66
Skipped tests: 4
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
  • TestAccNetworkSecuritySecurityProfile_networkSecuritySecurityProfileUrlFilteringUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@slevenick slevenick added this pull request to the merge queue Oct 3, 2025
Merged via the queue into GoogleCloudPlatform:main with commit 5714840 Oct 3, 2025
27 checks passed
jkrish-c pushed a commit to jkrish-c/magic-modules that referenced this pull request Oct 14, 2025
@matheusaleixo-cit matheusaleixo-cit deleted the add-new-url-filtering-feature-for-networksecurity-security-profile branch October 15, 2025 13:57
g-dreva pushed a commit to g-dreva/magic-modules that referenced this pull request Oct 15, 2025
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 20, 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