feat: install landscape-outbox snap#126
Conversation
There was a problem hiding this comment.
Pull request overview
Installs and manages the landscape-outbox snap (defaulting to latest/edge) and adds coverage to ensure the snap is installed, active, and refreshed on config changes.
Changes:
- Add
charmlibs-snapdependency to support snap install/refresh operations from the charm. - Install
landscape-outboxduringinstalland refresh/ensure it onconfig-changedbased onoutbox_snap_channel. - Add unit + integration tests validating installation, service activity, and failure behavior on invalid channels.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/charm.py |
Installs the snap on install, ensures/refreshes on config changes, and restarts the snap during service restart. |
src/config.py |
Adds outbox_snap_channel to the validated charm configuration model. |
config.yaml |
Introduces outbox_snap_channel config option (default latest/edge). |
pyproject.toml |
Adds charmlibs-snap runtime dependency. |
uv.lock |
Locks charmlibs-snap and updates project dependency metadata. |
tests/unit/conftest.py |
Adds a snap fixture to stub snap.add/snap.ensure in unit tests. |
tests/unit/test_charm.py |
Adds unit tests for snap ensure/install behavior and failure handling. |
tests/integration/test_bundle.py |
Adds integration test validating the snap is installed, active, and channel refresh failure is surfaced. |
jmucc
left a comment
There was a problem hiding this comment.
Should we also stop and start the outbox in the pause and resume actions? I tried manual testing against the legacy-db.bundle.yaml but the relations weren't accurate. I ran a model from bundle.yaml instead and I manaully verified the steps in the integration test work.
|
@jmucc yes, good catch. We should start/stop with the pause action too. I'll update. |
a22244d to
774f3a9
Compare
jmucc
left a comment
There was a problem hiding this comment.
Manually verified pause/resume stop/starts the outbox. LGTM.
Installs the
landscape-outboxsnap from thelatest/edgechannel. If the config is updated, the charm refreshes the snap to the specified channel.This is covered by an integration test that verifies that the snap is installed and active. If you want to run the integration test (and test manually with the deployed model), use the legacy bundle and set the PPA to the beta. Then you can test like so:
Before making a stable release of the charm, we'll need to get the outbox into
latest/stableas well so that the charm can default to that channel instead of edge. This should be possible within this week; I'll take care of updating the charm.