Skip to content

fix: surface third-party image builder failures as ImageBuildError (FLYTE-SDK-58) - #1369

Merged
EngHabu merged 2 commits into
mainfrom
fix/sentry-58-plugin-builder-error
Sep 3, 2026
Merged

fix: surface third-party image builder failures as ImageBuildError (FLYTE-SDK-58)#1369
EngHabu merged 2 commits into
mainfrom
fix/sentry-58-plugin-builder-error

Conversation

@EngHabu

@EngHabu EngHabu commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…LYTE-SDK-58)

Builders registered through the `flyte.plugins.image_builders` entry point (or
passed directly to `flyte.init(image_builder=...)`) are third-party code. When
one raised a bare exception, it travelled all the way out of
`ImageBuildEngine.build` unchanged and was recorded as an SDK crash.

FLYTE-SDK-58 is exactly that: a plugin builder raised

    RuntimeError: Failed to get GitHub credentials from git askpass -
    please reload your terminal or open a new session then try again.

which is a message about the user's own machine, not an SDK bug.

Wrap exceptions from non-builtin builders as `ImageBuildError` (a
`RuntimeUserError`, so `_is_user_error` filters it out of crash reporting)
while chaining the original as `__cause__`. Exceptions that already carry a
classification — `BaseRuntimeError` and the click control-flow exceptions — are
re-raised untouched, and the SDK's own Docker/remote builders are deliberately
left unwrapped so genuine SDK failures keep reaching Sentry.

Also convert the plugin *load* failure in `_load_custom_image_builders` from a
bare `RuntimeError` to `ImageBuildError` for the same reason.

fixes FLYTE-SDK-58

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
@EngHabu EngHabu added the sentry-fix Fix for an issue surfaced by Sentry label Aug 4, 2026

@EngHabu EngHabu left a comment

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.

LGTM

@EngHabu
EngHabu requested review from jeevb and pingsutw August 12, 2026 16:34
@EngHabu
EngHabu enabled auto-merge (squash) August 12, 2026 17:03
@EngHabu
EngHabu requested a review from kumare3 August 26, 2026 00:55
@EngHabu
EngHabu disabled auto-merge September 3, 2026 20:07
@EngHabu
EngHabu merged commit bb306b6 into main Sep 3, 2026
63 checks passed
@EngHabu
EngHabu deleted the fix/sentry-58-plugin-builder-error branch September 3, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sentry-fix Fix for an issue surfaced by Sentry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant