#1162 fix: include FlyteIgnore in default code-bundle ignores
Pull request opened by
AdilFayyaz
Motivation
Large git-tracked assets (e.g. git-lfs files) were being swept into code bundles even when listed in .flyteignore, bloating bundles on flyte run/flyte deploy with copy_style="all". PR
#1098 added a FlyteIgnore class (and a default_ignores constant) precisely to exclude git-tracked files, but it was never wired into build_code_bundle's fallback ignore set — which still used only StandardIgnore + GitIgnore, so .flyteignore had no effect on tracked files. This completes that fix.
Summary
• Add FlyteIgnore to the default ignore tuple in build_code_bundle (_code_bundle/bundle.py), so .flyteignore patterns now exclude all matching files, including git-tracked ones.
• Reuses the FlyteIgnore mechanism introduced in PR
#1098 — this change connects it to the actual bundler fallback used by flyte run/flyte deploy, which previously passed no ignores.
• Add a regression test exercising the default ignore path with a tracked file under .flyteignore.
Test Plan
• uv run python -m pytest tests/flyte/code_bundle/test_build_code_bundle.py tests/flyte/code_bundle/test_ignore.py → 34 passed, no regressions.
• New test test_build_code_bundle_default_ignores_respect_flyteignore: creates main.py, a tracked tests/images/big.bin, and a .flyteignore with tests/images/, then bundles with copy_style="all" and no explicit ignores; asserts main.py is present and tests/images/big.bin is excluded (fails without this change).
flyteorg/flyte-sdk