3.1 KiB
3.1 KiB
Tasks: Backup Scheduler & Unified Task UI
Phase 1: Setup
- T001 Initialize SQLite database
tasks.dband SQLAlchemy engine inbackend/src/core/database.py - T002 Create SQLAlchemy model for
TaskRecordinbackend/src/models/task.py - T003 Update
backend/src/core/config_models.pyto includeScheduleand updateEnvironmentmodel - T004 Create database migrations or initialization script for
tasks.db
Phase 2: Foundational
- T005 [P] Implement
TaskPersistencelayer inbackend/src/core/task_manager/persistence.py - T006 Update
TaskManagerinbackend/src/core/task_manager/manager.pyto use persistence for all jobs - T007 Implement
SchedulerServiceusingAPSchedulerinbackend/src/core/scheduler.py - T008 Integrate
SchedulerServiceinto main FastAPI application startup inbackend/src/app.py
Phase 3: [US1] Scheduled Backups
- T009 [US1] Implement schedule loading and registration logic in
SchedulerService - T010 [US1] Update
Environmentsettings API to handlebackup_scheduleupdates inbackend/src/api/routes/environments.py - T011 [P] [US1] Add schedule configuration fields to Environment edit form in
frontend/src/components/EnvSelector.svelte(or appropriate component) - T012 [US1] Implement validation for Cron expressions in backend and frontend
Phase 4: [US2] Unified Task Management UI
- T013 [US2] Implement
/api/tasksendpoint to list and filter tasks inbackend/src/api/routes/tasks.py - T014 [US2] Create new Tasks page in
frontend/src/routes/tasks/+page.svelte - T015 [P] [US2] Implement
TaskListcomponent infrontend/src/components/TaskList.svelte - T016 [US2] Add "Tasks" link to main navigation in
frontend/src/components/Navbar.svelte
Phase 5: [US3] Manual Backup Trigger
- T017 [US3] Implement
/api/tasks/backupPOST endpoint inbackend/src/api/routes/tasks.py - T018 [US3] Add "Run Backup" button and environment selection to Tasks page in
frontend/src/routes/tasks/+page.svelte
Phase 6: [US4] Task History & Logs
- T019 [US4] Implement
/api/tasks/{task_id}GET endpoint for detailed task info and logs inbackend/src/api/routes/tasks.py - T020 [US4] Implement
TaskLogViewercomponent infrontend/src/components/TaskLogViewer.svelte - T021 [US4] Integrate log viewer into TaskList or as a separate modal/page
Final Phase: Polish & Cross-cutting concerns
- T022 Implement task cleanup/retention policy (e.g., delete tasks older than 30 days)
- T023 Add real-time updates for task status using WebSockets (optional/refinement)
- T024 Ensure consistent error handling and logging across scheduler and task manager
Dependencies
- US1 depends on Phase 1 & 2
- US2 depends on Phase 1 & 2
- US3 depends on US2
- US4 depends on US2
Implementation Strategy
- Infrastructure First: Setup database and basic task persistence.
- Backend Logic: Implement scheduler and update task manager.
- API & UI: Build the unified tasks view.
- Feature Integration: Add scheduling UI and manual triggers.