feat: the Backups screen says whether backups are keeping up, and the System view warns when they aren't
CI and images / lint (push) Successful in 2s
CI and images / extension-version (push) Successful in 2s
CI and images / extension-test (push) Successful in 18s
CI and images / frontend-build (push) Successful in 25s
CI and images / backend-lint-and-test (push) Successful in 45s
CI and images / integration (push) Successful in 2m31s
CI and images / sign-extension (push) Successful in 3s
CI and images / build-agent (push) Successful in 5s
CI and images / build-web (push) Successful in 1m54s
CI and images / smoke-web (push) Successful in 48s
CI and images / promote (push) Successful in 1s
CI and images / refresh-dev (push) Skipped
CI and images / unattended-failure (push) Skipped

- A Backups row on Settings → System and the nav dot turn amber when the
  newest database dump is more than a day old or failed, or the weekly
  bucket check found files missing that no media run has sent since.
  No row when backups aren't set up.
- The weekly bucket check is kept as a run (kind "reconcile") with its
  counts, trimmed to the last 12, and listed on the Backups card.
- The Backups card leads with the same verdict and the newest dump's size,
  shows bytes beside the running media job's file count, and lets each run
  open its list of failed files with why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 17:51:39 -05:00
co-authored by Claude Opus 5.5
parent 9715143492
commit 66045794f0
11 changed files with 469 additions and 14 deletions
+30
View File
@@ -324,3 +324,33 @@ def test_reconcile_resends_what_the_bucket_lost_and_adopts_what_it_has(
"listed": 2, "dropped": 1, "adopted": 1,
}
assert set(db_sync.execute(select(BackupBlob.sha256)).scalars()) == {_sha("b")}
def test_the_weekly_check_is_kept_as_a_run_with_its_counts(db_sync, run_env, monkeypatch):
from backend.app.tasks import backup as tasks
monkeypatch.setattr(backup_media, "reconcile",
lambda session, target: {"listed": 9, "dropped": 2, "adopted": 1})
out = tasks.reconcile_media_backup()
row = db_sync.get(BackupRun, out["backup_run_id"])
db_sync.refresh(row)
assert (row.kind, row.status, row.triggered_by) == ("reconcile", "ok", "weekly")
assert row.finished_at is not None
assert {k: row.manifest[k] for k in ("listed", "dropped", "adopted")} == {
"listed": 9, "dropped": 2, "adopted": 1,
}
assert row.manifest["offsite"]["bucket"] == "curator"
def test_a_weekly_check_that_fails_is_kept_with_why(db_sync, run_env, monkeypatch):
from backend.app.tasks import backup as tasks
def unreachable(session, target):
raise S3Error("HTTP 503: busy.")
monkeypatch.setattr(backup_media, "reconcile", unreachable)
with pytest.raises(S3Error):
tasks.reconcile_media_backup()
row = db_sync.execute(select(BackupRun).where(BackupRun.kind == "reconcile")).scalar_one()
assert row.status == "error"
assert row.error == "S3Error: HTTP 503: busy."