|
|
0d6cade56c
|
feat: Add comprehensive configuration persistence system
- Implemented ConfigService with file-based JSON persistence
- Atomic file writes using temporary files
- Configuration validation with detailed error reporting
- Schema versioning with migration support
- Singleton pattern for global access
- Added backup management functionality
- Automatic backup creation before updates
- Manual backup creation with custom names
- Backup restoration with pre-restore backup
- Backup listing and deletion
- Automatic cleanup of old backups (max 10)
- Updated configuration API endpoints
- GET /api/config - Retrieve configuration
- PUT /api/config - Update with automatic backup
- POST /api/config/validate - Validation without applying
- GET /api/config/backups - List all backups
- POST /api/config/backups - Create manual backup
- POST /api/config/backups/{name}/restore - Restore backup
- DELETE /api/config/backups/{name} - Delete backup
- Comprehensive test coverage
- 27 unit tests for ConfigService (all passing)
- Integration tests for API endpoints
- Tests for validation, persistence, backups, and error handling
- Updated documentation
- Added ConfigService documentation to infrastructure.md
- Marked task as completed in instructions.md
Files changed:
- src/server/services/config_service.py (new)
- src/server/api/config.py (refactored)
- tests/unit/test_config_service.py (new)
- tests/api/test_config_endpoints.py (enhanced)
- infrastructure.md (updated)
- instructions.md (updated)
|
2025-10-17 20:26:40 +02:00 |
|