Skip to content

fix(auth): lower regional access boundary logs from warning to debug.#17571

Open
nbayati wants to merge 4 commits into
googleapis:mainfrom
nbayati:rab-log-info-level
Open

fix(auth): lower regional access boundary logs from warning to debug.#17571
nbayati wants to merge 4 commits into
googleapis:mainfrom
nbayati:rab-log-info-level

Conversation

@nbayati

@nbayati nbayati commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

When the library tries to look up Regional Access Boundaries in the background and fails, it used to print a "WARNING" message. Because these lookups are optional and failing is not considered fatal or blocking, omitting warnings creates a lot of log noise for the users. This change lowers those messages to the "DEBUG" level so they stay out of the way by default.

fixes #17515

When the library tries to look up Regional Access Boundaries in the background and fails, it used to print a "WARNING" message. Because these lookups are optional and failing is not considered fatal or blocking, omitting warnings creates a lot of log noise for the users. This change lowers those messages to the "INFO" level so they stay out of the way by default.
@nbayati nbayati requested review from a team as code owners June 25, 2026 03:41

@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 changes various Regional Access Boundary (RAB) lookup log messages from warning to info level and updates the test suite to verify this behavior. The reviewer pointed out that promoting the successful lookup log from DEBUG to INFO increases log noise for the happy path, which contradicts the goal of reducing noise, and suggested keeping it at DEBUG.

Comment thread packages/google-auth/google/auth/_regional_access_boundary_utils.py Outdated
@nbayati nbayati changed the title fix(auth): lower regional access boundary logs from warning to info. fix(auth): lower regional access boundary logs from warning to debug. Jun 25, 2026
e,
exc_info=True,
)
adapter_type = " asynchronous " if is_async else " "

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.

Why did we get rid of the is_logging_enabled check here? Was that intentional?

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.

Yes it was intentional. Previously, these were logged a WARNING. Because warnings are printed by default, we had to manually wrap it in that if check (which checks for DEBUG level) to hide it from normal users.

Now that we are logging them as _LOGGER.debug, they are already hidden by default. The logging library automatically filters out DEBUG logs, so we no longer need to write a manual if check to hide them.

is_cloned,
) = _prepare_async_lookup_callable(request)
except Exception as e:
if _helpers.is_logging_enabled(_LOGGER):

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.

Ditto on the removal of this check

)
)
except Exception as e:
if _helpers.is_logging_enabled(_LOGGER):

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.

Ditto

"Regional Access Boundary lookup failed. Entering cooldown."
in rab_caplog.text
)
# RAB failures should be logged at INFO level.

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.

INFO level comment is now obsolete it seems

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.

Thanks for the catch. I updated both the comment and the unit test to be more precise.

@nbayati nbayati requested a review from macastelaz June 25, 2026 18:15

@macastelaz macastelaz 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.

Looks like there may be a need to re-format (lint error). Otherwise LGTM.

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.

google-auth: benign Regional Access Boundary (trust boundary) lookup failure logged at WARNING on every service-account refresh

2 participants