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

Restore drill, step 1: runDrill() restores the newest snapshot into an empty directory, opens and counts it, and always removes it #1676

Closed opened this
Closed without merging

runDrill(deps) is in src/snapshot/drill.ts. It restores the newest snapshot into a fresh scratch directory under /drill/, opens forge.db read-only, counts repositories and issues, and opens one sealed value with the restored key. It removes the scratch directory in a finally.

Notes

stopped closed without shipping deploy af334e7

opened this

runDrill(deps) is in src/snapshot/drill.ts. It restores the newest snapshot into a fresh scratch directory under <dataDir>/drill/, opens forge.db read-only, counts repositories and issues, and opens one sealed value with the restored key. It removes the scratch directory in a finally. bun x tsc --noEmit, test/snapshot-drill.test.ts and test/check-list.test.ts pass; I did not run the rest of the suite.

What it returns: {at, snapshotId, ms, counts, verdict, failedStep, reason}. reason is a short message for the person reading, never a value. The step names are fetch, restore, open, count and unseal.

Timeout: one clock covers the whole drill, default 10 minutes and injectable as timeoutMs. A hang goes red naming the step it was in.

Tests: the new test/snapshot-drill.test.ts is added to GATE in scripts/gate.ts. It covers:

  • a seeded forge drills green with 1 repository and 2 issues;
  • a snapshot with no passphrase goes red at unseal;
  • a snapshot whose forge.db is junk of the right size goes red at open;
  • a hung restore goes red at restore on a 50 ms timeout;
  • an empty store goes red at fetch;
  • the scratch directory is gone after every case.

Left out, as scoped: no page and no schedule.

Choices to check:

  • A forge with nothing sealed passes the unseal step. It tries a forge secret first, then an app variable.
  • After a timeout the abandoned restore may still be running while the directory is removed. That can leave a stray write, and the next drill uses a new directory.

Closes #1667

commented

Parked by the crew: the check failed ("home is the feed > On you can be cleared in one move: a box each, select all, by kind and by repository, one form") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs