Fix/refactoring - #22
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (31)
📝 WalkthroughWalkthroughThis PR significantly restructures backup and restore services by decomposing monolithic implementations into modular, single-responsibility components. PostgreSQL database support is activated in Docker configuration, a new agent API restore endpoint is introduced with request/response models, and import paths are adjusted to reflect the new backup module organization. Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant AgentAPI as Agent API
participant ApiClient
participant BackendAPI as Backend Service
participant Database as Database
Client->>AgentAPI: POST /agent/{id}/restore<br/>(generated_id, status)
AgentAPI->>ApiClient: restore_result()
ApiClient->>BackendAPI: POST /agent/{id}/restore<br/>with ResultRestoreRequest
BackendAPI->>Database: Update restore status
Database-->>BackendAPI: Confirmation
BackendAPI-->>ApiClient: ResultRestoreResponse<br/>(message, status)
ApiClient-->>AgentAPI: Response
AgentAPI-->>Client: 200 OK
sequenceDiagram
participant Task as Dispatch Task
participant Executor as Executor
participant Runner as Runner
participant Compressor as Compressor
participant Uploader as Uploader
participant ResultSender as Result Sender
participant API as Backend API
Task->>Executor: execute_backup()
Executor->>API: create_backup_record()
API-->>Executor: backup_id
Executor->>Runner: run() backup operation
Runner-->>Executor: BackupResult
Executor->>Compressor: compress_backup()
Compressor-->>Executor: compressed_path
Executor->>Uploader: upload() to storages
Uploader->>API: backup_upload_init/status (per storage)
API-->>Uploader: UploadResult
Uploader-->>Executor: Vec<UploadResult>
Executor->>ResultSender: send_result()
ResultSender->>API: backup_update()
API-->>ResultSender: Confirmation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary by CodeRabbit
New Features
Infrastructure