<#663 Add support for .flyteignore file> Pull requ...
# flyte-github
a
#663 Add support for .flyteignore file Pull request opened by pingsutw ## Summary • Adds support for a custom
.flyteignore
file that works alongside
.gitignore
to exclude files from Flyte code bundles • Modified
GitIgnore
class to explicitly read patterns from both
.gitignore
and
.flyteignore
files using
--exclude-from
flags • Removed reliance on
--exclude-standard
flag for more explicit control over which ignore files are used • Added file existence checks to gracefully handle cases where
.gitignore
or
.flyteignore
don't exist ## Changes • `src/flyte/_code_bundle/_ignore.py`: Updated
_git_wrapper
,
_list_ignored_files
, and
_list_ignored_dirs
methods to check for file existence and use explicit exclude-from flags • `.gitignore`: Added
.flyteignore
to the repository's gitignore • `tests/flyte/code_bundle/test_ignore.py`: Added 3 comprehensive test cases covering: • Combined usage of both
.gitignore
and
.flyteignore
• Directory patterns in both files • Overlapping patterns with negation rules ## Test plan • All existing tests pass • New unit tests added and passing: •
test_gitignore_with_flyteignore
- Tests both files working together •
test_gitignore_flyteignore_directory_patterns
- Tests directory patterns •
test_gitignore_flyteignore_overlapping_patterns
- Tests pattern overlap and negation • Backward compatibility verified - works correctly when
.flyteignore
doesn't exist flyteorg/flyte-sdk