fix(drive): absolutize --backup-dir at resolution time - #1719
Merged
Merged
Conversation
A relative --backup-dir (or OMNI_DEV_DRIVE_LEASE_BACKUP_DIR, or settings.json's lease.backup_dir) was stored relative in the lease ledger. A later `drive lease prune` run from a different cwd would resolve the path against its own cwd, get NotFound, treat the backup as already gone, and drop the ledger row while the real backup file stayed on disk untracked; `drive lease restore` would fail outright. resolve_backup_dir now routes every non-default source through std::path::absolute, so the ledger always stores an absolute path regardless of the caller's cwd. Closes #1692
The prior commit fixed relative --backup-dir being stored relative in the lease ledger; add the CHANGELOG entry every other fix in this project already gets.
CoverageTotal: 97.27% ⚪ 0 pp vs Comparing
🔇 5 ignored region(s), 0 tolerated region(s)
Patch coveragePatch: 87.88% (29/33 new lines covered)
Uncovered new lines (4)
|
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
drive lease--backup-diris now absolutized before it's stored in the ledger — closing a bug wheredrive lease prune/restorerun from a different cwd would resolve a relative backup dir against the wrong directory, silently orphaning real backups.Test plan
cargo buildcargo test --lib drive::lease::settings::(23 passed)cargo clippy --all-targets -- -D warnings