Commit 4a78071
committed
fix: raise CodeBundleError for a missing include on the copy_style="none" path
`ls_relative_files` is the third site in `_code_bundle/_utils.py` that rejects an
`Environment.include` entry, and the only one still raising a bare `ValueError`.
It is reached from `build_code_bundle(copy_style="none", additional_files=...)`
via `build_code_bundle_from_relative_paths` -> `list_relative_files_to_bundle`,
so the path it complains about came straight from the user's `include=`.
Same reasoning as the two sites already converted in this PR: an include that
matches no file, directory or glob is the user's configuration, not an SDK bug,
so it should be a typed user error that crash reporting filters out instead of a
raw `ValueError` reported as a crash. The message is also reworded from
"File ... is not a valid file, directory, or glob pattern" to name the concept
the user actually typed ("include path ..."), matching its sibling in `ls_files`.
fixes FLYTE-SDK-5M
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>1 parent 8aa48d7 commit 4a78071
3 files changed
Lines changed: 33 additions & 3 deletions
File tree
- src/flyte/_code_bundle
- tests/flyte/code_bundle
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
235 | 241 | | |
236 | 242 | | |
237 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
444 | 466 | | |
445 | 467 | | |
446 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
245 | | - | |
| 247 | + | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
| |||
0 commit comments