feat: Add run_in_background parameter to sync endpoint with tests#417
Merged
feat: Add run_in_background parameter to sync endpoint with tests#417
Conversation
Add three new tests to verify the run_in_background=false parameter works correctly: - test_sync_project_endpoint_foreground: Verifies sync report structure is returned - test_sync_project_endpoint_foreground_with_force_full: Tests with force_full parameter - test_sync_project_endpoint_foreground_with_changes: Tests actual file change detection Also fixes bug where foreground sync was returning raw SyncReport dataclass instead of properly converting to SyncReportResponse, which caused the 'total' property to be missing from the JSON response. Coverage for project_router.py improved to 97%. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
phernandez
approved these changes
Nov 7, 2025
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
run_in_backgroundquery parameter to the/project/syncendpoint (defaults totruefor backward compatibility)run_in_background=false, the sync runs synchronously and returns a completeSyncReportResponseChanges
API Changes
run_in_backgroundquery parameter tosync_projectendpointtrue(maintains backward compatibility)false: Runs sync synchronously and returnsSyncReportResponsewith detailed change informationtrue: Runs in background and returns status message (existing behavior)SyncReportResponse.from_sync_report()for proper serializationTests Added
Three new comprehensive tests in
test_project_router.py:test_sync_project_endpoint_foreground- Verifies sync report structure when running in foregroundtest_sync_project_endpoint_foreground_with_force_full- Tests foreground sync withforce_full=truetest_sync_project_endpoint_foreground_with_changes- Tests that foreground sync detects actual file changesTest Plan
totalBenefits
🤖 Generated with Claude Code