fix: require unambiguous compatible backup selection - #114
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughChangesThe backup module now validates candidate compatibility and completeness before selection. Discovery searches recursively, supports explicit manifest paths, rejects unsupported selections, and avoids modification-time selection. Restore integration, documentation, and Pester coverage were updated. Backup discovery and selection
Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant RestoreBackup
participant FindBackupManifest
participant GetBackupCandidate
participant FileSystem
RestoreBackup->>FindBackupManifest: Pass explicit ManifestPath
FindBackupManifest->>FileSystem: Search selected path or backup containers
FileSystem-->>FindBackupManifest: Return manifest paths
FindBackupManifest->>GetBackupCandidate: Validate candidates
GetBackupCandidate-->>FindBackupManifest: Return compatibility and completeness
FindBackupManifest-->>RestoreBackup: Return selected path or error
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Backup discovery previously selected the newest filesystem timestamp without checking whether that backup was supported or complete. It now displays candidate identity, recorded timestamps, compatibility, and completeness, and auto-selects only a single supported, recorded-complete candidate. Ambiguous or incomplete discovery requires an explicit manifest file; selecting an unsupported file never falls back to another backup.
Supports explicit files and folders, including moved and nested backups. Discovery validates recorded verification metadata and path presence without hashing content; restore retains its full content checks. The agreed selection policy is documented in docs/BACKUP-FORMAT.md.
Validation: 76 distinct relevant Pester tests passed across discovery, backup hashes, restore outcomes/conflicts, canonical repository behavior, and repository checks. The 31 discovery/hash tests also passed under Windows PowerShell 5.1. Independent review is clean after correcting malformed verification-record selection.
Closes #39.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation