Skip to content

impl(auth): add universe_domain support for MDS#5329

Merged
alvarowolfx merged 2 commits intogoogleapis:mainfrom
alvarowolfx:feat-auth-mds-universe-domain
Apr 10, 2026
Merged

impl(auth): add universe_domain support for MDS#5329
alvarowolfx merged 2 commits intogoogleapis:mainfrom
alvarowolfx:feat-auth-mds-universe-domain

Conversation

@alvarowolfx
Copy link
Copy Markdown
Contributor

Towards #3646

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.79%. Comparing base (b43a714) to head (f23835e).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5329    +/-   ##
========================================
  Coverage   97.79%   97.79%            
========================================
  Files         220      220            
  Lines       45938    46039   +101     
========================================
+ Hits        44924    45025   +101     
  Misses       1014     1014            

☔ 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 8, 2026 17:01
@alvarowolfx alvarowolfx requested review from a team as code owners April 8, 2026 17:01
Comment on lines +406 to +407
let universe_domain = response.ok();
let _ = self.universe_domain.set(universe_domain.clone());
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.

If there is an error, the None will get cached indefinitely since we can't overwrite it due to the OnceLock. Even though the fetching code will be run again it won't be actually able to store future successful results.

Can we also add a test covering this case?

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.

Nevermind it seems like this is intentional, and the Some() will hold an option inside it.

A test covering this would be nice though anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is going to be improved with retries. It's a tricky think since in normal environments (GDU - googleapis.com), this call will fail, since the universe domain endpoint doesn't exist (404) on MDS. But we don't want to keep hitting it on a GDU, since in some parts it can make calls slower if is always trying to resolve the universe domain. With retries, I'm only gonna save on the OnceLock if the error is not retryable. I'll at least add a comment saying that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually, I can already write that code, since the error being returned is the same and I already can check if is transient. Working on it

@alvarowolfx alvarowolfx requested a review from suzmue April 9, 2026 21:09
@alvarowolfx alvarowolfx merged commit 0072823 into googleapis:main Apr 10, 2026
36 checks passed
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