Skip to content

Conversation

@JamesDuncanNz
Copy link
Contributor

@JamesDuncanNz JamesDuncanNz commented Dec 20, 2025

Description

This PR updates the LbRouteExtension resource to use the v1 API and introduces several new configuration options. It also corrects the basic example and documentation to align with supported features, specifically regarding event handling.

Changes:

API Update
  • Updated API reference URL from beta to v1
New Fields
  • Added supportedEvents field with documentation for valid REQUEST_* events
  • Added metadata field for extension chain configuration
  • Added requestBodySendMode field
  • Added observabilityMode field
Validation
  • Added custom validation function (ValidateSupportedEvent) that rejects invalid events:
    • EVENT_TYPE_UNSPECIFIED is rejected
    • RESPONSE_* events are rejected (not supported for LbRouteExtension)
    • Only REQUEST_* events are allowed
Documentation & Examples
  • Fixed network_services_lb_route_extension_basic.tf.tmpl to use only valid request-related events
  • Removed responseBodySendMode (not supported for LbRouteExtension)
  • Added external documentation links for ExtensionChain components
Testing
  • Added new example network_services_lb_route_extension_observability.tf.tmpl for observability_mode
  • Added acceptance tests to verify invalid events are rejected

Release Note Template for Downstream PRs (will be copied)

networkservices: migrated `google_network_services_lb_route_extension` resource to use the v1 API
networkservices: added `metadata`, `supported_events`, `request_body_send_mode`, and `observability_mode` fields to `google_network_services_lb_route_extension` resource

@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, 217 insertions(+), 9 deletions(-))
google-beta provider: Diff ( 4 files changed, 217 insertions(+), 9 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 63 insertions(+))
Open in Cloud Shell: Diff ( 1 file changed, 6 insertions(+))

Missing test report

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

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

resource "google_network_services_lb_route_extension" "primary" {
  extension_chains {
    extensions {
      observability_mode      = # value needed
      response_body_send_mode = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 86
Passed tests: 84
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • networkservices

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
  • TestAccNetworkServicesLbRouteExtension_networkServicesLbRouteExtensionBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@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, 917 insertions(+), 9 deletions(-))
google-beta provider: Diff ( 4 files changed, 917 insertions(+), 9 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 52 insertions(+))
Open in Cloud Shell: Diff ( 5 files changed, 456 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 87
Passed tests: 85
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • networkservices

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
  • TestAccNetworkServicesLbRouteExtension_networkServicesLbRouteExtensionObservabilityExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@JamesDuncanNz JamesDuncanNz marked this pull request as ready for review December 20, 2025 23:17
@github-actions github-actions bot requested a review from hao-nan-li December 20, 2025 23:18
@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.

@hao-nan-li, 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.

description: |
A set of events during request or response processing for which this extension is called.
This field is optional for the LbRouteExtension resource. If unspecified, `REQUEST_HEADERS` event is assumed as supported.
Possible values: `EVENT_TYPE_UNSPECIFIED`, `REQUEST_HEADERS`, `REQUEST_BODY`, `REQUEST_TRAILERS`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to add a check to validate the values provided in this array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've add validation for LbRouteExtension supported_events field and added a test to cover the validation.

- Add custom validation function to reject EVENT_TYPE_UNSPECIFIED and
RESPONSE_* events, which are not valid for LbRouteExtension
- Add acceptance test to verify invalid events are rejected
@github-actions github-actions bot requested a review from hao-nan-li December 23, 2025 22:12
@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 ( 5 files changed, 1281 insertions(+), 9 deletions(-))
google-beta provider: Diff ( 5 files changed, 1281 insertions(+), 9 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 64 insertions(+))
Open in Cloud Shell: Diff ( 5 files changed, 456 insertions(+))

@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 ( 5 files changed, 1281 insertions(+), 9 deletions(-))
google-beta provider: Diff ( 5 files changed, 1281 insertions(+), 9 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 64 insertions(+))
Open in Cloud Shell: Diff ( 5 files changed, 456 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 88
Passed tests: 86
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • networkservices

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
  • TestAccNetworkServicesLbRouteExtension_validation

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 88
Passed tests: 86
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • networkservices

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
  • TestAccNetworkServicesLbRouteExtension_validation

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@modular-magician
Copy link
Collaborator

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

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