fix: raise CodeBundleError for include paths outside the bundle root#1232
Open
EngHabu wants to merge 2 commits into
Open
fix: raise CodeBundleError for include paths outside the bundle root#1232EngHabu wants to merge 2 commits into
EngHabu wants to merge 2 commits into
Conversation
612973b to
c924bf1
Compare
c924bf1 to
162520b
Compare
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>
162520b to
61a67d6
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
Environment.includepath that resolves outside the bundle root raised a bareValueErrorfromls_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 inls_files(outside-the-root, and no-match glob) toCodeBundleError— aRuntimeUserErrorthat:_is_user_errorallowlist (RuntimeUserError).Tests
Updated
test_ls_files_rejects_path_outside_sourceto expectCodeBundleError; fulltest_includes.pysuite passes (10).fixes FLYTE-SDK-5M