Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

chore: Use AltContext to check DirectPath Used attribute - #4221

Merged
surbhigarg92 merged 4 commits into
mainfrom
directpath_used_attr
Nov 17, 2025
Merged

chore: Use AltContext to check DirectPath Used attribute#4221
surbhigarg92 merged 4 commits into
mainfrom
directpath_used_attr

Conversation

@surbhigarg92

Copy link
Copy Markdown
Contributor

This PR changes the logic to check if RPC has used DirectPath or not. Noe Alts Information will be used to check if DP is used instead of relying on IP address range

@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Nov 14, 2025
@surbhigarg92
surbhigarg92 marked this pull request as ready for review November 14, 2025 10:39
@surbhigarg92
surbhigarg92 requested review from a team November 14, 2025 10:39
@surbhigarg92 surbhigarg92 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 14, 2025
@rahul2393

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the logic for detecting DirectPath usage. Instead of checking the remote IP address, it now uses AltsContextUtil.check(), which inspects the ALTS context of the RPC. This is a good improvement as it's more robust and less brittle than relying on specific IP address prefixes. The changes are clean, and the removal of the now-unused isDirectPathUsed method and its related imports simplifies the code. Overall, this is a solid enhancement.

@surbhigarg92 surbhigarg92 removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 17, 2025
@surbhigarg92
surbhigarg92 merged commit ab7e2e0 into main Nov 17, 2025
41 of 43 checks passed
@surbhigarg92
surbhigarg92 deleted the directpath_used_attr branch November 17, 2025 15:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants