Repository navigation
feat(backups): WS-1 1.2 - db layer, models, backup agent command enqueue - #383
Merged
Merged
Conversation
…enqueue
Stacker side of the backup dump/restore executor (WS-1 1.2):
- Models (src/models/backup.rs): BackupDestination, BackupJob, BackupRun.
- DB layer (src/db/backup.rs): destination/job/run CRUD and run lifecycle
(pending -> running -> uploaded/failed/pruned), finished-run listing for
retention.
- Service (src/services/backup.rs): builds a typed DumpPlan/RestorePlan via
backup-core and queues a 'backup' agent command ({action, run_id, plan}).
The command references the per-run token only by env name (BACKUP_TOKEN) -
no secret is stored in the command queue.
Tests: src/services/backup unit tests (4) + tests/backup_db.rs runtime
validation of the SQL against the schema. Full suite green (2410 passed).
Agent-side native 'backup' command (Status Panel, status/ repo) executes the
plan and streams to storage - the remaining half of 1.2.
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
Stacker side of the backup dump/restore executor (WS-1 step 1.2). Builds on the
backup-corecrate (typedDumpPlan/RestorePlan) and the existing agent command queue.src/models/backup.rs):BackupDestination,BackupJob,BackupRun.src/db/backup.rs): destination/job/run CRUD and run lifecycle (pending → running → uploaded / failed / pruned), finished-run listing for retention.src/services/backup.rs): builds a typed execution plan viabackup-coreand queues abackupagent command ({action, run_id, plan}).Security
The command payload references the per-run bearer token only by environment-variable name (
BACKUP_TOKEN) — no secret value is stored in the command queue or logged. Destination credentials live only in Vault undervault_path.Testing
src/services/backupunit tests (4): plan building, command shape (no secrets), source validation.tests/backup_db.rs: runtime validation of the SQL against the schema (destination/job/run lifecycle).cargo fmt/cargo clippyclean.Next (rest of 1.2)
Agent-side native
backupcommand (Status Panel,status/repo) that executes the plan and streams to storage. Then 1.3 (storage connector), 1.4 (scheduler), 1.5 (REST/CLI/events), 1.6 (restore e2e).