<#1232 fix: raise CodeBundleError for include path...
# flyte-github
a
#1232 fix: raise CodeBundleError for include paths outside the bundle root Pull request opened by EngHabu Problem An
Environment.include
path that resolves outside the bundle root, or that matches no file / directory / glob, raised a bare
ValueError
from
ls_files
(
flyte._code_bundle._utils
) that leaked as a crash report: • FLYTE-SDK-5M — "include path '…/_path_setup.py' is outside the bundle root … Pass --root-dir …" • FLYTE-SDK-5Y — "include path '…' is not a file, directory, or matching glob pattern." Both messages are already user-actionable; neither should have been an unhandled SDK crash. Fix Convert the two include-path validation `ValueError`s 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
and
test_build_code_bundle_include_outside_source_raises
to expect `CodeBundleError`;
test_includes.py
suite passes. fixes FLYTE-SDK-5M fixes FLYTE-SDK-5Y flyteorg/flyte-sdk