Description
A backup is only useful if restore works. Add a scheduled CI job that takes a fresh DB snapshot, restores to a throwaway instance, runs schema and seed-data assertions, and reports against documented RPO/RTO targets.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
ops/backup/
- Must alert if RTO target exceeded
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/backup-restore-drills
- Implement changes
- Workflow
.github/workflows/restore-drill.yml (monthly schedule)
- Restore + run
src/scripts/verify-restore.ts
- Publish drill report artifact
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Corrupted snapshot must fail drill loudly
- Include test output and notes
Example commit message
feat: monthly backup restore drill job
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
A backup is only useful if restore works. Add a scheduled CI job that takes a fresh DB snapshot, restores to a throwaway instance, runs schema and seed-data assertions, and reports against documented RPO/RTO targets.
Requirements and context
ops/backup/Suggested execution
git checkout -b feat/backup-restore-drills.github/workflows/restore-drill.yml(monthly schedule)src/scripts/verify-restore.tsTest and commit
npm testExample commit message
feat: monthly backup restore drill jobGuidelines