-
Notifications
You must be signed in to change notification settings - Fork 54
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
Ingore empty paths in tar files. Fix regex match for .helmignore. #201
Open
derekadams
wants to merge
3
commits into
microbean:master
Choose a base branch
from
sitewhere:master
base: master
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.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
nbactions.xml | ||
src/site/markdown/*.html | ||
target/ | ||
/.classpath | ||
/.project |
This file contains 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
This file contains 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
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.
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.
Thanks for your PR. Won't this doubling-up of
File.separator
be valid only on Windows?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.
I don't think it's platform-specific since the slash is there to escape the other slash to make the regular expression valid. The use of
File.separator
is misleading in this scenario because it's really just a slash in the regular expression. We are using the code in Linux-based containers and it's working with no issues.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.
The reason I'm asking is because normally in a regular expression you escape something with a backslash. And on windows, indeed
File.separator
would be a backslash. But on Linux, it would be a forward slash, which doesn't escape anything. I'll see if I can put a test together to reproduce the issue you're talking about.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.
Also what's odd in this particular case is that
[^x]
means "a single character that is notx
". So[^/]
, for example, means "a single character that is not/
". You've changed this to be, exactly,[^//]
, which means...I'm actually not entirely sure what it means 😄. Maybe[^xx]
is equivalent to[^x]
; not sure. Anyway, I'm somewhat surprised here—not that there isn't a problem; I believe you—but that doubling a forward slash inside a single character negation pattern would somehow be responsible for fixing it.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.
I agree. My guess is that it fails on Windows (or at least doesn't work as intended). I'll replace the file separators with \ characters so that it acts consistently.
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.
But then you'll end up with
[^\\]
, which means "any character that is not a backslash", and I doubt that's actually what you mean. I think we'll need a test here to show the behavior that you're observing.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 can't say I understand 100% what this logic is doing. My best guess is that it's attempting to emulate wildcard behavior by skipping all non backslash characters after the
*
(or one in the case of?
). If that's the case, I think the updated code is valid. There are test cases here for a lot of the potential.helmignore
patterns and they are passing with the updated code.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.
Do you have a link showing the problematic behavior with the current code? Better yet, could you attach such a test case to your PR, such that it fails with the current microbean-helm codebase, but passes with your PR changes? I need to fully understand the problem that these changes are claiming to solve.