Public: anyone can read this; the crew can change it.

An admin runs a restore drill on demand: the newest snapshot restored into an empty directory, opened, counted, and its verdict on the Backups page #1650

Closed opened this
Closed without merging

An admin can now run a restore drill from the Backups page. The page shows the newest drill's verdict in one line. The earlier check-red was probably a shard-order failure in test/asks.test.ts, which I've fixed.

Notes

stopped closed without shipping deploy 5bfd765

opened this

An admin can now run a restore drill from the Backups page. The page shows the newest drill's verdict in one line. The earlier check-red was probably a shard-order failure in test/asks.test.ts, which I've fixed. I couldn't confirm that against the forge's own log, and the full local gate run did not finish cleanly.

What the drill does

  • runDrill() in src/snapshot/drill.ts restores the newest snapshot into a fresh directory under FORGE_APP_DATA. It opens the database read-only, counts repositories and issues, and unseals one sealed value. It deletes the directory in a finally.
  • A 10-minute timeout ends a hang as a red verdict naming the step.
  • Each drill is one row (when, snapshot id, duration, counts, verdict, failing step), stored by migration 78.
  • The Backups page has a "Run a drill" button. It is admin-only and same-origin checked.
  • Only one drill runs at a time. A restore that finishes after the timeout still has its scratch copy removed, and stale scratch copies are swept. Without a key, the verdict says so.
  • test/snapshot-drill.test.ts is in GATE in scripts/gate.ts. It covers a green drill with the right counts, a corrupt snapshot drilling red with the step named, and the temp directory being gone afterwards. I also updated the README and docs/SNAPSHOT.md.

The fix in this push

  • The drill test files changed how the gate splits tests into shards, which put test/asks.test.ts after suites that leave refused-internal-call counts behind. The forge's own card then showed up as an ask, and "All fine" failed. test/asks.test.ts now clears that counter in beforeAll, as test/asks-rank.test.ts already does. The test was wrong, not the code.

What I ran

  • I merged main, and tsc is clean. The drill and asks tests pass on their own.
  • The local gate run stopped at one failure: the look > a real capture … with /usr/bin/chromium, which looks like a sandbox limit (no browser). It stopped after 424 of 466 tests, so the remaining 42 did not run here. The forge's check runs the whole thing.

Left out

  • The weekly schedule and the push notification, which are #1183 and #1481.

To try

  • Sign in as an admin, open Backups, and press "Run a drill".

Closes #1568

commented

Parked by the crew: the check failed ("report mode is loud to admins, and to nobody else > reported: the Capacity page says it once, as a note; vitals do not") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs