Skip to content

impl(gax-internal): use universe_domain when creating gRPC/HTTP transport#5302

Open
alvarowolfx wants to merge 4 commits intogoogleapis:mainfrom
alvarowolfx:impl-gax-universe-domain-transport
Open

impl(gax-internal): use universe_domain when creating gRPC/HTTP transport#5302
alvarowolfx wants to merge 4 commits intogoogleapis:mainfrom
alvarowolfx:impl-gax-universe-domain-transport

Conversation

@alvarowolfx
Copy link
Copy Markdown
Collaborator

Towards #3646

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 96.87500% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.78%. Comparing base (146ab54) to head (b4efc64).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/gax-internal/src/host.rs 93.75% 3 Missing ⚠️
src/gax-internal/src/http.rs 97.61% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5302    +/-   ##
========================================
  Coverage   97.78%   97.78%            
========================================
  Files         220      220            
  Lines       45833    45939   +106     
========================================
+ Hits        44818    44923   +105     
- Misses       1015     1016     +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.

@alvarowolfx alvarowolfx marked this pull request as ready for review April 7, 2026 15:13
@alvarowolfx alvarowolfx requested a review from a team as a code owner April 7, 2026 15:13
let universe_domain =
crate::universe_domain::resolve(config.universe_domain.as_deref(), &credentials)
.await
.map_err(BuilderError::transport)?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this a transport error? The client does not even try to initialize the transport layer. It fails before then because of bad configuration.

Should we expand the ClientBuilder::Error to have a case for mismatched universe domains?


mockall::mock! {
#[derive(Debug)]
Credentials {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside, non-blocking: We don't need to define this more than once per crate.

And we could even put it in google-cloud-test-utils to define it once for all tests

universe_domain: &str,
) -> Result<(Uri, String), HostError> {
let default_origin = Uri::from_str(default_endpoint).map_err(HostError::Uri)?;
let default_endpoint = default_endpoint.replace(DEFAULT_UNIVERSE_DOMAIN, universe_domain);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: this isn't really the "default" after we swap in a custom universe domain.

Comment on lines +74 to +75
custom_host.strip_suffix(&custom_suffix),
default_host.strip_suffix(&custom_suffix),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems wrong. The universe domain is not necessarily tied to the endpoint right?

Like for the .with_endpoint("foo.googleapis.com").with_universe_domain("my-universe-domain.com") example.

The host should be "foo.googleapis.com" but this would return "foo.my-universe-domain.com"

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