Skip to content

Comments

feat: add --sync-files flag while synchronzing#261

Merged
mesaugat merged 38 commits intomasterfrom
feat/add-sync-files-command
Feb 4, 2026
Merged

feat: add --sync-files flag while synchronzing#261
mesaugat merged 38 commits intomasterfrom
feat/add-sync-files-command

Conversation

@samirsilwal
Copy link
Collaborator

Changes

  • Add --sync-files flag to synchronize command
  • It is list of objects that is to be synchronized
  • This introduces an explicit way of providing only the specific object to be synced
  • The path should be list of relative paths to base path given in sync-db yaml
  • When there is non empty sync files provided, teardown process in synchronize is skipped and we simply update the objects

@samirsilwal samirsilwal self-assigned this Jan 21, 2026
@samirsilwal samirsilwal changed the title Add --sync-files sub command while synchronzing Add --sync-files flag while synchronzing Jan 21, 2026
@samirsilwal
Copy link
Collaborator Author

Remove result from sync-logs

@mesaugat mesaugat changed the base branch from feat/add-command-log-table to master January 29, 2026 09:21
@samirsilwal samirsilwal force-pushed the feat/add-sync-files-command branch from 010a0af to 62a5b89 Compare January 29, 2026 10:49
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 5.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.66%. Comparing base (04f794a) to head (ec39773).
⚠️ Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
src/service/sync.ts 0.00% 16 Missing ⚠️
src/commands/synchronize.ts 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@samirsilwal samirsilwal requested a review from mesaugat January 30, 2026 12:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-files parameter to SynchronizeParams interface for specifying files to sync
  • Modified synchronization logic to detect partial sync mode and skip teardown when sync-files is 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.

'sync-files': ['function/schema/test_func.sql']
};

const isPartialSync = params.hasOwnProperty('sync-files');
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@mesaugat mesaugat changed the title Add --sync-files flag while synchronzing feat: add --sync-files flag while synchronzing Feb 4, 2026
@mesaugat mesaugat merged commit ac726b6 into master Feb 4, 2026
3 of 5 checks passed
@mesaugat mesaugat deleted the feat/add-sync-files-command branch February 4, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants