← Back to issue list

actions: introduce helpers to install & inject snaps (CRAFT-253)

View original Github issue

Metadata

Project
craft-providers
Number
#45
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

PR #45 (commit 5e8109c, merged via 3573b67) added snap_installer.install_from_store() and inject_from_host() helpers plus installed_snap/core20_lxd_instance test fixtures, with unit and integration tests.

Resolution: closed resolved

Reason: The pull request itself was merged into main by maintainer cjp256 (merge commit 3573b67 'Merge pull request #45 from cjp256/snap-helpers'), with review approved by 2 reviewers, landing the new snap install/inject helpers and test fixtures.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- add snap_installer.install_from_store() to install a snap in a target environment, pulling from the store. - add snap_installer.inject_from_host() to install snap from the currently-installed version on the host. First attempts to download the snap using the snapd API, falling back to `snap pack` in case the snapd API fails (as happens when a snap is installed using `snap try`. - add core20_lxd_instance fixture for integration tests to provide integration test environment for helpers. - add installed_snap contextmanager fixture to install snaps on host for a guest. - add integration & unit test coverage. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR #45 (commit 5e8109c, merged via 3573b67) added snap_installer.install_from_store() and inject_from_host() helpers plus installed_snap/core20_lxd_instance test fixtures, with unit and integration tests.
qwen/qwen3.6-35b-a3b — closed resolved Merged PR introducing snap_installer.install_from_store() and inject_from_host() helpers, plus test fixtures for installing and injecting snaps in target environments.

Update history

Date Change
created

Related work

  • Related To: craft-providers#444 (confidence 60%)

    Later commit 03704c1 'feat(snaps): inject base snap from host' builds on the host-injection helper introduced here.

Related issues

Issue Project State Summary Similarity
#46 util: introduce snap_cmd module for snap command helpers craft-providers merged Merged PR #46 (commit a859b39, merged as 11a414c) added craft_providers/util/snap_cmd.py with snap command helpers (ack, known, local/remote install, pack, refresh, remove) plus unit tests.
74%
#1782778 Improve installation/injection logic for snapcraft (and core) snapcraft (launchpad) closed Installation and host-injection logic was resolved in canonical/craft-providers PR #45, merged as commit 3573b67 under CRAFT-253.
73%
#1364 lxd: Inject snapcraft and core snaps into the container snapcraft merged Merged PR #1364 as 99f5598ac, injecting the host's Snapcraft and core snaps into LXD containers so builds no longer use a mismatched Xenial archive version.
73%
#1782777 Improve installation/injection logic for snapcraft (and core) snapcraft (launchpad) closed Fixed by merged snapcore/snapcraft PR #2196 in commit d9a477ea5, improving build-provider installation and snap injection logic.
73%
#2222 lxd: support new style snap injection snapcraft merged Merged in #2222 via commit 8acd203, adding new-style LXD snap handling, removing sudo-based injection, and consolidating duplicated tests.
72%
#2524 Snapcraft try snapcraft merged Merged snapcraft try via PR #2524 (commit ec579eaa1); LXD tests were split out because they require Snapcraft installed from the store.
71%
#4084 providers: inject current snapcraft snap into instances snapcraft merged Merged PR #4084 as commit b852f9ac8, injecting the current Snapcraft snap into provider instances so parallel-installed instances can build core22 snaps.
70%
#121 snap installer: refactor installation logic craft-providers merged Merged PR #121 (commit 8b7dede, merge 58abe9b), refactoring snap installation to install or refresh from the store, support host/store switching, and expand tests.
70%
#152 snap installer: refactor craft-providers merged Merged PR #152 in commit 0e51d9a, refactoring snap_installer without functional changes and adding integration coverage for dangerously installed snaps.
70%