fix(streamer): prevent skipPath from over-matching .git prefix - #409
fix(streamer): prevent skipPath from over-matching .git prefix#409mohit-bhandari45 wants to merge 5 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/ok-to-test |
|
@mohit-bhandari45 Thanks for your contribution apparently there's something wrong with the release notes |
There was a problem hiding this comment.
🟡 Changes recommended
UNC path handling and test boundary assertions must be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
pkg/shp/streamer/tar.go:34
- This blank line contains trailing whitespace, so the changed file is not
gofmt-clean. Please remove it to keep the Go source formatter-compliant.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
|
@mohit-bhandari45 may you check the Copilot comments whether they are of relevance. Also, make sure to sign your commits, otherwise we cannot accept them. https://github.com/shipwright-io/cli/pull/409/checks?check_run_id=100509499395 |
00e9d3f to
eef48b6
Compare
|
@SaschaSchwarze0 Updates are done and commits are signed. |
This fixes a bug where skipPath would unintentionally drop files that happened to share the .git prefix (such as .gitignore, .gitmodules) by ensuring it matches the exact .git directory boundary. Also normalizes cross-platform paths using filepath.ToSlash to prevent Windows path bugs. Signed-off-by: mohit-bhandari45 <mohitbhandari852@gmail.com>
Signed-off-by: mohit-bhandari45 <mohitbhandari852@gmail.com>
Signed-off-by: mohit-bhandari45 <mohitbhandari852@gmail.com>
6d7ba1f to
1c81106
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The nested .git filtering and invalid archive member handling must be corrected.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
pkg/shp/streamer/tar_test.go:42
- The claimed Windows/UNC behavior is not exercised here.
filepath.ToSlashuses the host OS separator, and the unit workflow runs only on Ubuntu (.github/workflows/unit.yaml:16), so this remains a no-op in CI and cannot catch regressions in Windowsfilepath.Relor separator handling. Please add Windows-specific coverage (or extract a platform-independent matcher that can be tested with Windows-style paths).
cleanName := filepath.ToSlash(name)
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
Signed-off-by: mohit-bhandari45 <mohitbhandari852@gmail.com>
Signed-off-by: mohit-bhandari45 <mohitbhandari852@gmail.com>
Changes
This fixes a bug where
skipPathin the streamer would unintentionally drop files that shared the.gitprefix, such as.gitignore,.gitmodules, and.gitattributes. The matcher now checks the source-relative path and only excludes a path component named.git.The relative-path comparison also preserves Windows UNC paths correctly.
Additionally, it normalizes cross-platform paths using
filepath.ToSlashprior to string matching to safeguard against path comparison bugs when the CLI is run on Windows machines.Related Issue
Fixes #408
Type of PR
/kind bug
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes