-
Notifications
You must be signed in to change notification settings - Fork 1
✨ Improve preview command with smart exclusions and dry-run #186
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9fe966e to
9ece70c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9ece70c to
25f0822
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
PR Review: Preview Command ImprovementsI've reviewed the changes in this PR. Overall, the improvements are solid and well-implemented. Below are my findings organized by category: ✅ Strengths1. Native FormData Migration
2. Smart Default Exclusions
3. Dry-Run Feature
4. User Experience
|
🐛 Potential Issues1. SECURITY: Command Injection Vulnerability in Exclusion Handling The exclusion patterns are interpolated directly into shell commands without proper escaping (src/commands/preview.js:178-181). If a user passes a malicious exclusion pattern, it could lead to command injection. Impact: Critical security vulnerability Recommendation: Escape exclusion patterns or use array-based command execution. The isPathSafe function only validates sourceDir, not exclusion patterns. 2. Windows Platform Exclusions Not Applied On Windows (PowerShell path), exclusions are not passed to the zip command. The comment mentions server-side filtering but this was not mentioned in the PR description. Impact: Windows users will upload excluded files (node_modules, tests, etc.), leading to larger uploads and potentially exposing unwanted files. Recommendation: Filter files before archiving on Windows, or document this limitation clearly. 3. Missing Test Coverage for New Features The test file (tests/commands/preview.test.js) does not cover:
Recommendation: Add tests for these features to prevent regressions. |
|
🔒 Security Summary
💡 RecommendationsMust Fix Before Merge:
Should Fix:
Nice to Have:
SummaryThis PR adds valuable features (dry-run, smart exclusions) that improve the preview command significantly. However, there is a critical security vulnerability in the exclusion pattern handling that must be addressed before merging. The missing test coverage for new features is also concerning and should be remedied. The native FormData migration is solid and well-tested. The dry-run feature implementation is thoughtful with good UX. Recommendation: Request changes to fix the security issue and add test coverage before merging. |
- Fix form-data upload issue by using native FormData/Blob for fetch compatibility - Add smart default exclusions for non-static files (node_modules, tests, configs, etc.) - Add --dry-run flag to show what would be uploaded without uploading - Add --exclude/-x flag to add custom exclusion patterns - Add --include/-i flag to override default exclusions - Show helpful error message when path argument is missing - Skip API token validation for dry-run mode
25f0822 to
1e6799d
Compare
🐻 Vizzly — 14 changes need review
Changes needing review (14)filter-failed-only · Firefox · 1920×1080 · 1.2% diff search-homepage · Firefox · 1920×1080 · 0.2% diff search-no-results · Firefox · 1920×1080 · 0.2% diff fullscreen-viewer · Firefox · 1920×1080 · 5.8% diff bulk-accept-dialog · Firefox · 1920×1080 · 10.3% diff viewer-toggle-mode · Firefox · 1920×1080 · 0.7% diff ...and 8 more in Vizzly. CLI Reporter · |
🐻 Vizzly — 1 change needs review
CLI TUI · |







Summary
FormData/Blobfor fetch compatibility (theform-datanpm package doesn't stream correctly with Node's native fetch)node_modules,tests/,__tests__/,coverage/,*.config.js,package.json,*.md, etc.--dry-runflag to preview what would be uploaded without actually uploading--exclude/-xflag to add custom exclusion patterns (repeatable, use trailing/for directories)--include/-iflag to override default exclusions (e.g.,--include package.json)Test plan
vizzly preview ./dist --dry-runto verify file listing worksvizzly preview ./dist --dry-run --verboseto see exclusion listsvizzly preview ./dist --dry-run --exclude "*.css"to test custom exclusionsvizzly preview ./dist --dry-run --include package.jsonto test including excluded filesvizzly preview(no path) to verify helpful error message