-
Notifications
You must be signed in to change notification settings - Fork 309
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
Open
jjbustamante
wants to merge
4
commits into
main
Choose a base branch
from
jjbustamante/fix-pack-2402
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+427
−4
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]> Signed-off-by: Juan Bustamante <[email protected]>
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 <[email protected]> Signed-off-by: Juan Bustamante <[email protected]>
- 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 <[email protected]> Signed-off-by: Juan Bustamante <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Juan Bustamante <[email protected]>
c62871e
to
9862d50
Compare
edmorley
reviewed
Jun 28, 2025
@@ -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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type/chore
Issue that requests non-user facing changes.
type/enhancement
Issue that requests a new feature or improvement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 directoryfoo
and all its contents are completely excluded from the build process.Output
Before
When using
project.toml
with:The build would show:
The empty
foo/
directory was still present during build and in the final image.After
With the same
project.toml
configuration, the build now shows:The
foo/
directory is completely excluded, with no empty directory artifacts.Documentation
Related
Resolves #2402