feat: add --sync-files flag while synchronzing#261
Conversation
|
Remove result from sync-logs |
010a0af to
62a5b89
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #261 +/- ##
==========================================
- Coverage 35.34% 34.66% -0.68%
==========================================
Files 33 33
Lines 863 874 +11
Branches 115 120 +5
==========================================
- Hits 305 303 -2
- Misses 549 567 +18
+ Partials 9 4 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request adds a --sync-files flag to the synchronize command, enabling partial synchronization of specific database objects. When this flag is provided, the teardown process is skipped and only the specified files are synchronized.
Changes:
- Added optional
sync-filesparameter toSynchronizeParamsinterface for specifying files to sync - Modified synchronization logic to detect partial sync mode and skip teardown when
sync-filesis provided - Implemented CLI flag parsing for comma-separated file paths
- Added unit tests for file filtering and partial sync detection logic
- Updated documentation with usage examples
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/domain/SynchronizeParams.ts | Adds optional sync-files property to support partial synchronization |
| src/service/sync.ts | Implements partial sync logic, file filtering, and conditional teardown skipping |
| src/commands/synchronize.ts | Adds CLI flag definition and parsing for comma-separated file paths |
| test/unit/service/sync.test.ts | Adds unit tests for file filtering and partial sync detection |
| test/cli/commands/synchronize.test.ts | Adds test to verify --sync-files flag appears in help message |
| README.md | Updates documentation with sync-files flag description and usage example |
| .github/workflows/build-publish.yml | Upgrades Node.js versions and GitHub Actions versions (unrelated change) |
| src/migration/service/knexMigrator.ts | Removes blank line (unrelated whitespace change) |
| src/domain/operation/OperationContext.ts | Reorders interface properties (unrelated stylistic change) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/unit/service/sync.test.ts
Outdated
| 'sync-files': ['function/schema/test_func.sql'] | ||
| }; | ||
|
|
||
| const isPartialSync = params.hasOwnProperty('sync-files'); |
There was a problem hiding this comment.
The test uses hasOwnProperty('sync-files') to detect partial sync, which matches the implementation in src/service/sync.ts:120. However, this approach has a flaw: it will return true even when 'sync-files' is explicitly undefined. Consider updating both the test and implementation to check for defined values instead, or add a test case that verifies the behavior when 'sync-files' is explicitly set to undefined.
whatthecommit.com ¯\_(ツ)_/¯
Changes