Repository navigation
feat(apps): snap backend — plan operations, execution, detection, facade wiring - #21
Merged
Merged
Conversation
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.
Adds Snap as a backend in toride-apps, end to end except registry routing.
Planner.
Operation::SnapInstall { name, channel },SnapUninstall, andSnapUpdaterendersnap install [--channel=<track>/<risk>[/branch]],snap remove, andsnap refresh. There is noInstallMethod::Snapyet (snapcraft.io source data is a later registry round), so snap operations are constructed at the operation seam — the argv contract is the same as every routed method's.SnapBackend (
backends/snap.rs) executes them through the sharedCommandRunner:detect()is a PATH check — no command runs.version()reads thesnap <version>client row fromsnap version.error:with exit 1, snapd unreachable, unknown snap) surfaces asError::Commandcarrying snapd's stderr.-placeholders). A malformed row is skipped, never fatal to the listing; a non-empty document where nothing parses is treated as unparseable output, not an empty host.Detection and facade.
MultiSourceDetectorgains aDetectionSource::Snapprobe over the installed listing.AppsBuildergrows asnapslot plus auto-attach, records carryNativeIds::Snap { name }so uninstall and update replaysnap remove/snap refreshfrom the recorded name alone, and status routes snap through the recorded/foreign presence seams, async and sync.Snap-less hosts. An absent
snapbinary makesdetect()returnBinaryNotFound, which the builder skips like any other missing manager — nothing errors, snap installs answerBackendUnavailable, and status never probes the slot.Tests. Offline suites pin argv, table parsing, and the facade flows (adopt / update / uninstall) against strict
FakeRunnerfakes with tabwriter-shaped fixtures.tests/live.rs, gated behindTORIDE_APPS_INTEGRATION, exercisesdetect()and the read-onlyversion/list/ per-snap status probes against the real host, branching on whether snap exists — no mutating command anywhere.Gates: test, fmt, clippy, doc, workspace-check — all pass.