fix: raise InitializationError for invalid auth mode#1194
Open
EngHabu wants to merge 1 commit into
Open
Conversation
An unrecognized auth mode in the creds config previously raised a bare ValueError from the authenticator factory. During SelectCluster it was wrapped as RuntimeError -> RuntimeSystemError and leaked to Sentry as an SDK crash with no actionable signal, even though it is a user-config mistake (FLYTE-SDK-50). Raise a typed InitializationError so the Sentry user-error filter skips it and the user gets a clear 'update the creds config' message. fixes FLYTE-SDK-50 Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
8587c33 to
c968bc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An unrecognized auth mode in the creds config raised a bare
ValueErrorfrom the authenticator factory (_authenticators/factory.py). DuringSelectClusterit gets wrapped asRuntimeError("SelectCluster failed...")→RuntimeSystemErrorand leaked to Sentry as an SDK crash with no actionable signal — even though it's a user-config mistake.Sentry: FLYTE-SDK-50 —
RuntimeSystemError: ... Invalid auth mode [None] specified. Please update the creds config to use a valid valueFix
Raise a typed
InitializationError(a user-facing error already in the Sentry filter's allowlist) instead of a bareValueError. The Sentry user-error filter walks the cause chain and now skips it, and the user still gets the clear 'update the creds config' message.Tests
test_get_async_authenticator_invalid_mode_raises_initialization_error— factory raisesInitializationErrorforNone/bogus modes.test_capture_exception_skips_invalid_auth_mode_wrapped_as_system_error— the wrappedRuntimeSystemErrorchain is filtered from Sentry.fixes FLYTE-SDK-50