Skip to content

tgc-revival: Refactor FindIdentityParams to use multi-segment logical AND matching#16762

Draft
zli82016 wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
zli82016:tgc-identity-params
Draft

tgc-revival: Refactor FindIdentityParams to use multi-segment logical AND matching#16762
zli82016 wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
zli82016:tgc-identity-params

Conversation

@zli82016
Copy link
Member

@zli82016 zli82016 commented Mar 19, 2026

Previously, the FindIdentityParams function within the TGC generator attempted to identify a single uniquely distinguishing URL path segment (IdentityParam) to differentiate between Terraform resources that share the exact same CAI asset type.

However, this naive approach fails on complex resource groupings like compute.googleapis.com/FirewallPolicy, where resources like NetworkFirewallPolicy and RegionNetworkFirewallPolicy share parameters globally and regionally, meaning they require a combination of path segments (e.g., "projects" AND "global") to be reliably identified.

This PR completely refactors the identity parsing logic to aggressively group all identifying segments together rather than isolating just one.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@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.

terraform-google-conversion: Diff ( 1 file changed, 26 insertions(+), 26 deletions(-))

@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.

terraform-google-conversion: Diff ( 1 file changed, 26 insertions(+), 26 deletions(-))

@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.

terraform-google-conversion: Diff ( 1 file changed, 26 insertions(+), 26 deletions(-))

@zli82016 zli82016 changed the title Tgc identity params tgc-revival: Refactor FindIdentityParams to use multi-segment logical AND matching Mar 19, 2026
@zli82016
Copy link
Member Author

/gcbrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants