feat(update): bare uffs --update updates end-to-end (ordinary-user default)#441
Merged
Merged
Conversation
…default)
The surgical phases (snapshot/acquire/apply/doctor/recover) are a power-user
toolkit; the ordinary user types `uffs --update` and expects it to *update*.
Make the bare command do exactly that — and only when needed.
`uffs --update` (no action) now:
1. detects the install + reads the latest release (one non-mutating fetch via
a new lean `uffs-update check` helper subcommand that prints `latest=<tag>`),
2. if a newer release is available OR the install is version-skewed → runs the
full journaled acquire+apply (auto-rollback on failure),
3. otherwise prints "✓ UFFS is already up to date (vX.Y.Z)" and touches
nothing — crucially it does NOT stop/restart services when current.
The old detect-only behaviour moves to the explicit, non-mutating
`uffs --update check` ("is an update available?" → "✓ Up to date" /
"⬆ Update available: vX — run `uffs --update` to install"). Offline → a clear
notice, no error.
- uffs-update: `check` subcommand (resolves latest via the existing
`github::fetch_release`, prints `latest=<tag>`).
- uffs-cli: `acquire::latest_version()` spawns it; `assess()` →
`UpdatePlan::{UpToDate,Available,Offline}` drives bare-update vs `check`;
`normalize_tag` strips the leading `v` for comparison (unit-tested).
- Help, module docs, and cli-grammar.md §5 updated (none = update; + `check`).
Host + Windows-MSVC clippy clean; 129 uffs-cli/uffs-update tests pass; smoke:
`check`→"Up to date (v0.6.5)", bare→no-op when current.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The surgical phases (
snapshot/acquire/apply/doctor/recover) are a power-user toolkit. The ordinary user typesuffs --updateand expects it to update — so now it does, and only when needed.uffs --update(no action)uffs-update checkhelper subcommand (latest=<tag>, no download).✓ UFFS is already up to date (vX.Y.Z)and touches nothing — crucially it will not stop/restart services when already current.The old detect-only view →
uffs --update checkNon-mutating "is an update available?":
✓ Up to date (vX)/⬆ Update available: vX — run \uffs --update` to install`. Offline → a clear notice, no error.snapshot/acquire/apply/doctor/recoverare unchanged.Implementation
checksubcommand (resolves latest via the existinggithub::fetch_release, printslatest=<tag>).acquire::latest_version()spawns it;assess()→UpdatePlan::{UpToDate,Available,Offline}drives bare-update vscheck;normalize_tagstrips a leadingvfor comparison (unit-tested).cli-grammar.md §5updated (none = update;+ check).Verification
check→ "Up to date (v0.6.5)"; bareuffs --update→ no-op when current (no service restart).