Skip to content

fix: support locational endpoints#3402

Merged
dbolduc merged 1 commit intogoogleapis:mainfrom
dbolduc:support-locational-endpoints
Sep 25, 2025
Merged

fix: support locational endpoints#3402
dbolduc merged 1 commit intogoogleapis:mainfrom
dbolduc:support-locational-endpoints

Conversation

@dbolduc
Copy link
Copy Markdown
Member

@dbolduc dbolduc commented Sep 24, 2025

Part of the work for #3375. (The other half is gRPC).

When a client is configured to use a locational / regional endpoints, use them as the host, instead of the default host (global).

The client library detects these automatically. (Whereas, in C++, we decided to expose an AuthorityOption). If you have more test cases for custom endpoints, I will happily add them.

Adds an integration test that fails without the corresponding changes to the gaxi client.

I did not think about whether we should do the same thing for gRPC based clients. The answer is probably. It would be easy enough to refactor host_from_endpoint and the related tests.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.22%. Comparing base (2fbd614) to head (3d1b4f7).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3402      +/-   ##
==========================================
+ Coverage   96.19%   96.22%   +0.03%     
==========================================
  Files         115      115              
  Lines        4573     4587      +14     
==========================================
+ Hits         4399     4414      +15     
+ Misses        174      173       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbolduc dbolduc marked this pull request as ready for review September 25, 2025 02:44
@dbolduc dbolduc requested a review from a team September 25, 2025 02:44
Copy link
Copy Markdown
Collaborator

@coryan coryan left a comment

Choose a reason for hiding this comment

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

I did not think about whether we should do the same thing for gRPC based clients. The answer is probably.

I agree.

It would be easy enough to refactor host_from_endpoint and the related tests.

https://cloud.google.com/storage/docs/regional-endpoints

So maybe we should do that now?

@coryan
Copy link
Copy Markdown
Collaborator

coryan commented Sep 25, 2025

@dbolduc
Copy link
Copy Markdown
Member Author

dbolduc commented Sep 25, 2025

So maybe we should do that now?

Definitely. I will merge this PR because it adds functionality and isn't obviously wrong. Then probably send a refactor PR. Then send another PR that adds support to the gRPC client (with integration tests).

@dbolduc dbolduc merged commit 60a1545 into googleapis:main Sep 25, 2025
25 checks passed
@dbolduc dbolduc deleted the support-locational-endpoints branch September 25, 2025 14:49
PhongChuong pushed a commit to PhongChuong/google-cloud-rust that referenced this pull request Sep 29, 2025
Part of the work for googleapis#3375. (The other half is gRPC).

When a client is configured to use a locational / regional endpoints,
use them as the host, instead of the default host (global). The client
library detects these automatically.

Adds an integration test that fails without the corresponding changes to
the `gaxi` client.
dbolduc added a commit that referenced this pull request Oct 6, 2025
Fixes #3375 

Use locational endpoints as the `:authority` field in gRPC requests,
instead of the default. An analog to #3402, but for gRPC.
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