-
Notifications
You must be signed in to change notification settings - Fork 0
feat: CLI command integration for sync operations (Task 9) #7
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
Implement Task 9.1-9.5: CLI command integration for sync operations Changes: - Make sync modules public in lib.rs for CLI access - Export SyncEngine and SyncReporter from sync module - Implement to-local command handler with full sync integration - Implement to-global command handler with full sync integration - Add path resolution (HOME/USERPROFILE for global, cwd for local) - Add CLI argument to Config mapping - Add ConflictMode to ConflictStrategy conversion - Add type filter to glob pattern conversion - Update CLI tests to not expect 'Not yet implemented' - Add Default implementations for unit structs per clippy Task Progress: - ✅ Subtask 9.1: CLI Command Handlers implemented - ✅ Subtask 9.2: SyncEngine integration complete - ✅ Subtask 9.3: SyncReporter integration complete - ✅ Subtask 9.4: Conflict resolution using config strategies - ✅ Subtask 9.5: Error handling with context propagation Test Results: - 87 library tests pass - 19 CLI integration tests pass - All tests green (106/106) Note: Some CLI flags (--global-path, --local-path, --preserve-symlinks, --config, --no-config) are parsed but not yet implemented in handlers. These will be added in a follow-up commit. Related: #9
…tion The scanner was replacing file paths with resolved symlink targets, causing strip_prefix to fail when syncing directories containing symlinks (e.g., NixOS /nix/store paths). The fix keeps the original path (relative to scan root) in ScannedFile while still validating that symlinks are not broken. This allows: - Correct relative path calculation in sync engine - Proper destination path construction - Symlink target validation without path replacement Fixes the error: Failed to strip prefix from /nix/store/.../file.md Tested with: - to-local sync with symlinked global config (NixOS) - to-global sync - Dry-run mode - Skip identical files logic
Show breakdown of why files were skipped in the sync summary. The output now displays skip counts with reasons in parentheses: Skipped: 8 (identical content: 8) This helps users understand why no operations were performed: - 'identical content' - files already exist and match source - 'source doesn't exist' - file exists in dest but not in source - Multiple reasons are sorted by frequency Improves user experience by making sync results more transparent and eliminating confusion about why operations were skipped.
Code Review: PR #7 - CLI Command Integration for Sync OperationsExecutive SummaryThis PR implements CLI command handlers for Overall Assessment: Critical Issues1. 🔴 SECURITY: Path Traversal Vulnerability in
|
Summary
Implements Task 9: CLI Command Integration for Sync Operations
This PR integrates the SyncEngine from Task 6 with the CLI command handlers, making the
to-localandto-globalcommands fully functional.Changes
Bug Fixes
Enhancements
Skipped: 8 (identical content: 8)Test Results
-D warningsBinary Status
The
ccsyncbinary is now fully functional:Future Work
Some CLI flags are parsed but not yet wired up (tracked for future PRs):
Closes #9