feat: restore inside the Vault; the Refresh page and file export UI are gone
- POST /refresh-runs accepts snapshot_id: restore a snapshot somebody picked (a restorable capture of the relation's own source, never a safety copy or another orbit's) through the same run engine - refresh-relations carries source_orbit_id; snapshots carry kind (capture|safety), and the UI hides safety copies - snapshot detail: Restore replaces Export file on hub (disabled with No restore point without a relation); modal with a restore point selector, a ten second countdown with Abort, and a four step progress view - administrators keep Other registered target; the Refresh menu and refresh-only screen are removed - proven with a real agent and PostgreSQL in the browser: capture, restore to Development, abort, no relation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -372,10 +372,20 @@ was shown: `REFRESH <source> TO <target> v<version>`. The caller never picks the
|
||||
overwritten);
|
||||
3. follows the restore job to its end.
|
||||
|
||||
In the web UI, people holding a relation grant use **Refresh** (administrators find it in the rail too). Someone whose
|
||||
only permission is a relation grant gets that single screen: the vault screens are not loaded for them, since every
|
||||
request would be refused. The screen shows what will be overwritten, requires an explicit confirmation, follows the
|
||||
run, and lets the person cancel until the target starts being overwritten.
|
||||
A run can also restore a snapshot somebody picked instead of capturing a new one: add `snapshot_id` to the request. The
|
||||
snapshot must be a restorable database capture of the relation's own source orbit (never a safety copy, never another
|
||||
orbit's); otherwise the answer is `422 snapshot_unusable` and nothing is started. Such a run has no capture step, but
|
||||
everything else is the same: one run per target at a time, idempotency, cancelling until the target is overwritten, and
|
||||
the authorisation checks right before overwriting. The same snapshot can be restored to several targets, and again later.
|
||||
|
||||
In the web UI there is no separate Refresh screen. Restoring lives in the Vault: pick an orbit, capture it if you want the
|
||||
latest data (or click a snapshot that is already there), and in the snapshot detail press **Restore**. The button is
|
||||
disabled with "No restore point" when no relation has been set up for the orbit. The modal offers the restore points
|
||||
(Development and/or Staging) that the person may use, shows what will be overwritten, and after **Begin restore** counts
|
||||
ten seconds in the browser, during which **Abort** sends nothing. Then it follows four steps (Checking, Safety copy,
|
||||
Applying, Completed) from the run, and Abort still works until Applying starts. Safety copies are not listed with the
|
||||
backups. A person needs to see the orbit's snapshots (for example the viewer role on the orbit) and a relation grant;
|
||||
administrators can also restore to any other registered target from the same modal.
|
||||
|
||||
States: `capturing`, `restoring`, then `completed`, or `capture_failed`, `restore_failed`, `blocked` (with a reason),
|
||||
`expired`, `cancelled`, `recovery_required` (the restore was interrupted after it started overwriting: an administrator
|
||||
|
||||
Reference in New Issue
Block a user