Add snapshot restore action to BOS Settings #24
No reviewers
Labels
No labels
breadbug
bug
displays
enhancement
keybinds
network
phase-1
power
privacy
recovery
search
snapshots
sound
ui
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Breadway/bos-settings!24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/bset-22-snapshot-restore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a confirmed Restore selected snapshot and reboot action to Settings > Snapshots. The backend validates the snapshot number, invokes
pkexec bos-restore-snapshot <number>, and passes the helper confirmation through stdin. The confirmation explains that the current@root is preserved as a backup and that the system reboots after restore. Existing snapshot listing, GRUB boot, and delete actions remain available.Verified:
npm run check,npm run build,node --experimental-strip-types frontend/src/lib/snapshotRestore.test.mjs(3 passing headless cases),cargo test --locked(77 passed),cargo build --locked,cargo clippy --all-targets --locked -- -D warnings, andcargo fmt -- --check. The Rust invocation test uses temporary stub commands and does not call a real restore helper or reboot.Closes #23
Synced to its parent BSET-22: implementation is in PR #24 at
5e45c88; local frontend, headless confirmation, Cargo, formatting, build and Clippy checks pass. Forgejo run 97 is waiting to run, so this PR card is in DOING pending the required check.Implementation is linked to PR #24. Frontend checks/build, headless confirmation tests, and Rust tests/build/Clippy/format passed. Forgejo CI was pending at last check. Moving to REVIEW for independent review; if CI fails, return it to TODO with the failure recorded.
Not merged yet: this now conflicts with #38 in
src/src/commands/snapshots.rs. Both PRs replace/rewrite the#[cfg(test)] mod testsblock, so only the tests collide; the production code merges cleanly (restore_snapshotnext to the new JSONget_snapshots). Rebase onto main and keep both test sets (the snapper-JSON parser tests from #38 plus this PR's restore tests). #38's row shape (number,date,description) is unchanged, so no UI rework is needed. Once rebased it is good to merge.Reconciled onto current main (11 commits, including the snapper JSON list rework in #38 and the retention copy in #22). The only conflict was the test module in
src/src/commands/snapshots.rs: main'sparse_snapper_jsontests and this PR's restore tests are now one module, with the rest of the PR auto-merging cleanly.Verified at the merge commit (
84d5f1c), from a scratch worktree:npm run check: 0 errors, 0 warnings;npm run build: wrote site tobuild.node --experimental-strip-types frontend/src/lib/snapshotRestore.test.mjs: 3/3 pass.cargo test --locked: 110 passed, 0 failed, including all sevensnapshots::testscases (main's five plus the two restore tests).cargo clippy --all-targets --locked -- -D warnings: clean.cargo fmt -- --check: clean.Reviewed against the helper merged in BOS (
iso/airootfs/usr/local/bin/bos-restore-snapshot): the exactRESTORE <n>stdin line, argument validation without leading zeros, thepkexecinvocation (already the established pattern in this repo), and the preserve-then-reboot semantics all match, and the confirmation copy insnapshotRestore.tsnames both the preserved @ root and the automatic reboot.