-
Notifications
You must be signed in to change notification settings - Fork 325
Fix project.toml directory exclusion behavior #2404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
cdbb47c to
0d61b4c
Compare
This change fixes unexpected behavior when excluding directories with trailing slash patterns in project.toml. Previously, patterns like "foo/" would exclude files within the directory but still create empty directory entries in the final image. Changes: - Enhanced getFileFilter() to properly exclude directories when patterns end with "/" - Modified WriteDirToTar() to skip entire directory trees using filepath.SkipDir - Fixed isNil() function in testhelpers to properly handle nil function pointers - Added comprehensive tests for directory exclusion scenarios The fix ensures that when users specify exclude = ["foo/"] in project.toml, the directory "foo" and all its contents are completely excluded from the build process, eliminating the unexpected empty directory artifacts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
The previous fix was too broad and broke other tests that expected different nil behavior for interfaces, channels, maps, and slices. This change restricts the fix to only handle the specific case of nil function pointers while maintaining compatibility with existing tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
- Enhanced getFileFilter to include parent directories when files within them match include patterns - Fixed compile error in acceptance test framework fmt.Sprint -> fmt.Sprintf - Added comprehensive test for parent directory inclusion behavior - Ensures directories like 'media' are included when 'media/mountain.jpg' is in include patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
c62871e to
9862d50
Compare
| @@ -0,0 +1,153 @@ | |||
| # CLAUDE.md | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Could you move the unrelated changes to a separate PR? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.
|
I want to release |
Summary
Fixes unexpected behavior when excluding directories with trailing slash patterns in
project.toml. Previously, patterns like"foo/"would exclude files within the directory but still create empty directory entries in the final image. This change ensures that when users specifyexclude = ["foo/"], the directoryfooand all its contents are completely excluded from the build process.Output
Before
When using
project.tomlwith:The build would show:
The empty
foo/directory was still present during build and in the final image.After
With the same
project.tomlconfiguration, the build now shows:The
foo/directory is completely excluded, with no empty directory artifacts.Documentation
Related
Resolves #2402