Skip to content

fix(servicedirectory): add diff suppress for project ID/number on endpoint network field - #18584

Open
vr-ibm wants to merge 4 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:f-service-directory-endpoint-network-diff-suppress
Open

fix(servicedirectory): add diff suppress for project ID/number on endpoint network field#18584
vr-ibm wants to merge 4 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:f-service-directory-endpoint-network-diff-suppress

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

The network field on google_service_directory_endpoint was marked immutable: true
(ForceNew) with no diff suppression. When users specify the network using a project ID
(projects/my-project/locations/global/networks/my-network), the GCP API returns the
project number form (projects/123456789/locations/global/networks/my-network). Terraform's
raw string comparison detects a diff and, because the field was ForceNew, destroys and
recreates the endpoint on every plan/apply.

Details

  • Removes immutable: true from the network field on google_service_directory_endpoint
  • Adds diff_suppress_func: tpgresource.CompareSelfLinkRelativePathsIgnoreProjectId to treat
    project ID and project number forms as equivalent
  • GCP API accepts both forms as valid input — this is purely a Terraform-side normalization fix

Release Note Template for Downstream PRs (will be copied)

google_service_directory_endpoint: fixed perpetual diff on `network` field when project ID is used instead of project number

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/servicedirectory and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Aug 10, 2026
@modular-magician

modular-magician commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 2efabac:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 383 insertions(+), 4 deletions(-)
google-beta provider View Diff 4 files changed, 383 insertions(+), 4 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
1570 1471 95 4
Affected Service Packages
  • compute
  • servicedirectory

Learn how VCR tests work


Step 1: Replaying Mode

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
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeRouterPeer_AddMd5AuthenticationKey
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
  • TestAccDataSourceGoogleComputeServiceAttachments_basic

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeRouterPeer_AddMd5AuthenticationKey
✅ Log TestAccDataSourceGoogleComputeServiceAttachments_basic
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@vr-ibm VCR tests complete for 2efabac!

@vr-ibm
vr-ibm marked this pull request as ready for review August 10, 2026 20:53
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.

2 participants