Skip to content

impl(auth): create auth errors based on gax errors#5350

Merged
alvarowolfx merged 2 commits intogoogleapis:mainfrom
alvarowolfx:impl-auth-retryable-gax
Apr 10, 2026
Merged

impl(auth): create auth errors based on gax errors#5350
alvarowolfx merged 2 commits intogoogleapis:mainfrom
alvarowolfx:impl-auth-retryable-gax

Conversation

@alvarowolfx
Copy link
Copy Markdown
Contributor

@alvarowolfx alvarowolfx commented Apr 9, 2026

Improve how auth errors are classified as transient based on gax errors. Previously, we were just checking if the gax::error had an CredentialError as source and if it was transient. But other gax errors can also be considered transient, based on status code, internal reqwest::Error and etc. This PR creates a helper to be reused across the auth crate.

@alvarowolfx
Copy link
Copy Markdown
Contributor Author

Split from work on #5310

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.79%. Comparing base (f173ee7) to head (a250c51).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
src/auth/src/credentials/mds.rs 0.00% 1 Missing ⚠️
src/auth/src/errors.rs 95.83% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5350   +/-   ##
=======================================
  Coverage   97.79%   97.79%           
=======================================
  Files         222      222           
  Lines       46386    46405   +19     
=======================================
+ Hits        45364    45383   +19     
  Misses       1022     1022           

☔ 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 9, 2026 20:46
@alvarowolfx alvarowolfx requested review from a team as code owners April 9, 2026 20:46
Comment thread src/auth/src/errors.rs Outdated
Comment thread src/auth/src/credentials.rs
Copy link
Copy Markdown
Contributor

@suzmue suzmue left a comment

Choose a reason for hiding this comment

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

nit: I see in the the tests that the is_transient result we expected changed from this improvement. Might be nice to expand on what exactly has been improved in the description and why we saw that change.

Comment thread src/auth/src/errors.rs Outdated
Comment thread src/auth/src/errors.rs Outdated
@alvarowolfx
Copy link
Copy Markdown
Contributor Author

nit: I see in the the tests that the is_transient result we expected changed from this improvement. Might be nice to expand on what exactly has been improved in the description and why we saw that change.

@suzmue I've updated the PR description to mention why is an improvement and addressed other review comments

@alvarowolfx alvarowolfx merged commit a7dba23 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.

3 participants