Refuse a backup destination an unplugged volume left empty (closes #239)
check / check (push) Successful in 12m49s

Every backup now writes vaultik-destination.txt at the root of the
backup destination store. While the local index holds snapshots, a
destination without it is not present: snapshot create refuses before
writing, prune and snapshot purge fail, and snapshot list and snapshot
remove warn, as for a destination that cannot be listed. remote nuke
deletes the marker last. The file:// backend no longer creates its
destination directory and checks for it on every write.

Tests that backed up into a directory they never created now use an
existing one; fixtures standing for a written destination carry the
marker.

Judgement call: the marker is rewritten on every backup.
Deviation: snapshot name selection moved out of CreateSnapshot unchanged, for the complexity limit.

Model: opus-5-5
This commit is contained in:
2026-10-13 02:17:47 +00:00
parent 07c957f84b
commit d35eec435b
35 changed files with 543 additions and 98 deletions
+3
View File
@@ -44,6 +44,9 @@ func setupPurgeTest(
repos := database.NewRepositories(db)
mockStorage := NewMockStorer()
// A backup wrote to this destination, so it carries the marker.
require.NoError(t, mockStorage.Put(ctx, markerFile, strings.NewReader("")))
// Insert each snapshot into the DB and create remote metadata stubs.
// Use timestamps parsed from snapshot IDs for realistic ordering.
for _, id := range snapshotIDs {