Skip to content

Conversation

@SCSAndre
Copy link
Contributor

Description

Fixes #20398

This PR resolves a perma-diff issue in google_service_networking_connection where the order of reserved_peering_ranges caused Terraform to detect changes during every plan, even if the set of ranges remained identical.

Changes

  • Schema Change: Changed reserved_peering_ranges from TypeList to TypeSet in resource_service_networking_connection.go (and added unordered_list: true to metadata).
  • Test: Added TestAccServiceNetworkingConnection_reorder to resource_service_networking_connection_test.go to verify that changing the order of ranges does not trigger an update.

Breaking Change Note

This changes the schema type from List to Set.

  • Impact: Existing state files store this as a list.
  • Mitigation: tpgresource.ConvertStringArr handles the conversion via .List(). Please review if a specific StateUpgrader is required for this resource, or if the standard Terraform refresh is sufficient for this string set.

Verification

I have verified this locally by running the new acceptance test:
make testacc TEST=./google/services/servicenetworking TESTARGS='-run TestAccServiceNetworkingConnection_reorder'
Result: PASS

`google_service_networking_connection`: fixed a permanent diff issue where changing the order of `reserved_peering_ranges` triggered an unnecessary update.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 22, 2026
@github-actions github-actions bot requested a review from shuyama1 January 22, 2026 21:58
@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.

@shuyama1, 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
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 ( 3 files changed, 97 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 3 files changed, 97 insertions(+), 3 deletions(-))

Breaking Change(s) Detected

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

  • Field reserved_peering_ranges changed from TypeList to TypeSet on google_service_networking_connection - 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.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 9
Passed tests: 8
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • servicenetworking

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

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