fix(manage): backup status reports the newest full-host snapshot #272

Merged
jfraeys merged 1 commit from jfraeys/fix/backup-status-full-snapshot into main 2026-10-17 18:58:17 -04:00
Owner

manage backup status used the newest snapshot of any kind. That is normally the 6-hourly Vaultwarden snapshot (paths under /tmp), so every service showed ? not found in snapshot and the FRESH/STALE verdict measured the wrong backup: a fresh Vaultwarden snapshot would hide a stale daily full-host backup.

  • Freshness and per-service coverage now come from the newest snapshot tagged infra (the daily job's tag; also what restore_pick_snapshot treats as full-host).
  • The newest vaultwarden-snapshot is shown on its own line (informational).
  • No infra-tagged snapshot at all: error, exit 1, names the newest snapshot of any kind.
  • Snapshot age is parsed with the UTC offset honoured (the old BSD date -j path read it as local time); an unparsable time reads as stale, never fresh.
  • Tests: scripts/tests/test-backup-status.sh (stubbed restic, wired into lint). The existing restore-snapshot and manage-bundle tests still pass.

On-host manage gets this only after ./infra deploy --tags manage_cli --limit services; the operator-side ./manage backup status picks it up with a git pull.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

`manage backup status` used the newest snapshot of any kind. That is normally the 6-hourly Vaultwarden snapshot (paths under /tmp), so every service showed `? not found in snapshot` and the FRESH/STALE verdict measured the wrong backup: a fresh Vaultwarden snapshot would hide a stale daily full-host backup. - Freshness and per-service coverage now come from the newest snapshot tagged `infra` (the daily job's tag; also what `restore_pick_snapshot` treats as full-host). - The newest `vaultwarden-snapshot` is shown on its own line (informational). - No `infra`-tagged snapshot at all: error, exit 1, names the newest snapshot of any kind. - Snapshot age is parsed with the UTC offset honoured (the old BSD `date -j` path read it as local time); an unparsable time reads as stale, never fresh. - Tests: `scripts/tests/test-backup-status.sh` (stubbed restic, wired into lint). The existing restore-snapshot and manage-bundle tests still pass. On-host `manage` gets this only after `./infra deploy --tags manage_cli --limit services`; the operator-side `./manage backup status` picks it up with a `git pull`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(manage): backup status reports the newest full-host snapshot, not the newest snapshot
All checks were successful
Lint / lint (pull_request) Successful in 3m6s
Secret scan / scan (pull_request) Successful in 15s
495441d6ae
The newest snapshot is usually the 6-hourly Vaultwarden one (paths under /tmp), so every service
read 'not found in snapshot' and freshness measured the wrong backup. Status now uses the newest
snapshot tagged infra, shows the Vaultwarden snapshot on its own line, and fails when there is no
full-host snapshot. Age is computed with the UTC offset honoured.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!272
No description provided.