Skip to content

fix: raise CodeBundleError for include paths outside the bundle root#1232

Open
EngHabu wants to merge 2 commits into
mainfrom
fix/sentry-5m-bundle-root
Open

fix: raise CodeBundleError for include paths outside the bundle root#1232
EngHabu wants to merge 2 commits into
mainfrom
fix/sentry-5m-bundle-root

Conversation

@EngHabu

@EngHabu EngHabu commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Problem

An Environment.include path that resolves outside the bundle root raised a bare ValueError from ls_files (flyte._code_bundle._utils) that leaked as a crash report — surfaced in Sentry as FLYTE-SDK-5M ("include path '…/_path_setup.py' is outside the bundle root … Pass --root-dir …"). The message is already user-actionable; it should never have been an unhandled SDK crash.

Fix

Convert the two include-path validation ValueErrors in ls_files (outside-the-root, and no-match glob) to CodeBundleError — a RuntimeUserError that:

  • keeps the same helpful message, and
  • is filtered from crash reporting via the _is_user_error allowlist (RuntimeUserError).

Tests

Updated test_ls_files_rejects_path_outside_source to expect CodeBundleError; full test_includes.py suite passes (10).

fixes FLYTE-SDK-5M

@EngHabu EngHabu added the sentry-fix Fix for an issue surfaced by Sentry label Jun 19, 2026
@EngHabu EngHabu force-pushed the fix/sentry-5m-bundle-root branch 5 times, most recently from 612973b to c924bf1 Compare June 26, 2026 16:11
@EngHabu EngHabu force-pushed the fix/sentry-5m-bundle-root branch from c924bf1 to 162520b Compare June 28, 2026 16:07
EngHabu added 2 commits June 29, 2026 09:04
An Environment.include path that resolves outside the bundle root (or matches
no file) raised a bare ValueError that leaked as a crash report (FLYTE-SDK-5M),
even though the message is already user-actionable ("Pass --root-dir ...").
Convert these to CodeBundleError (a RuntimeUserError), which keeps the same
helpful message but is filtered from Sentry as a user configuration error.

fixes FLYTE-SDK-5M

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
@EngHabu EngHabu force-pushed the fix/sentry-5m-bundle-root branch from 162520b to 61a67d6 Compare June 29, 2026 16:04
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