fix(init): validate apply-patchset paths generically#1042
Merged
Conversation
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 80.65%. Project has 4296 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.99% 82.03% +0.04%
==========================================
Files 329 329 —
Lines 23883 23908 +25
Branches 15603 15630 +27
==========================================
+ Hits 19581 19612 +31
- Misses 4302 4296 -6
- Partials 1651 1650 -1Generated by Codecov Action |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Moves install patch path safety to the CLI apply-patchset tool boundary. The tool now rejects absolute paths, drive-prefixed paths, backslashes, empty segments,
., and..as normal tool errors, while still allowing ordinary nested project-relative files like.csprojpaths.This pairs with the cli-init-api change that stops hardcoding package-manager metadata filenames: https://github.com/getsentry/cli-init-api/pull/170.
Test Plan
pnpm exec biome check src/lib/init/tools/apply-patchset.ts test/lib/init/tools/filesystem-tools.test.tspnpm exec vitest run test/lib/init/tools/filesystem-tools.test.ts