Skip to content

feat: support local landscape-server .deb via Juju resource - #129

Open
jansdhillon wants to merge 6 commits into
canonical:mainfrom
jansdhillon:feat/deb-resource-install
Open

feat: support local landscape-server .deb via Juju resource#129
jansdhillon wants to merge 6 commits into
canonical:mainfrom
jansdhillon:feat/deb-resource-install

Conversation

@jansdhillon

@jansdhillon jansdhillon commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Add a landscape-server-deb file resource. When attached at deploy time, the charm installs it directly instead of pulling from the PPA. The PPA is still added first so all dependencies are available. The upgrade action also checks for the resource and installs from it when present. --no-install-recommends is passed only when min_install=true. When no resource is attached the behaviour is unchanged.

Manual testing

Download the deb to the repo root:

wget https://launchpad.net/~landscape/+archive/ubuntu/self-hosted-daily/+files/landscape-server_26.04~rc1-0landscape0~noble_amd64.deb

Temporarily add the resource to bundle-examples/bundle.yaml. Also, add the self-hosted-daily PPA since that's where we're pulling the deb from. The path is relative to the bundle file, so reference the deb from the repo root with ../:

landscape-server:
  charm: ../landscape-server_ubuntu@24.04-amd64.charm
  ...
  options:
      landscape_ppa: "ppa:landscape/self-hosted-daily"
      ...
  ...
  resources:
    landscape-server-deb: ../landscape-server_26.04~rc1-0landscape0~noble_amd64.deb

Deploy:

make deploy

Verify the local deb was installed:

juju ssh landscape-server/0 "sudo apt policy landscape-server"
# Installed: 26.04~rc1-0landscape0~noble

Add a landscape-server-deb file resource. When attached, the charm
installs it directly instead of pulling from the PPA. The PPA is still
added first so all dependencies are available.
Comment thread src/charm.py Outdated
Comment thread src/charm.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for installing landscape-server from an optional locally-provided .deb Juju resource, intended to bypass fetching the package from the Landscape PPA while still using the PPA for dependencies.

Changes:

  • Add landscape-server-deb file resource to charm metadata.
  • Update charm install logic to install from an attached .deb resource with --no-install-recommends.
  • Add/adjust unit and integration tests covering .deb resource behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/charm.py Adds resource fetch helper and conditional install-from-local-deb logic in the install hook.
metadata.yaml Declares optional landscape-server-deb file resource.
tests/unit/conftest.py Adds an empty_deb_resource fixture for scenario-based unit tests.
tests/unit/test_charm.py Updates existing PPA tests and adds new unit tests for local-deb install behavior.
tests/integration/test_bundle.py Adds an integration test that attaches the resource and expects the charm to install from it.

Comment thread tests/unit/test_charm.py Outdated
Comment thread tests/integration/test_bundle.py Outdated
Comment thread src/charm.py Outdated
Comment thread src/charm.py Outdated
Comment thread tests/unit/test_charm.py Outdated
jansdhillon and others added 4 commits April 28, 2026 19:14
- Switch to from pathlib import Path with real annotation
- Use assert_any_call instead of brittle str(call) matching
- Drop duplicate test, rename ppa-path test to reflect empty-resource fixture
- Remove integration test (hard to revert, covered by unit tests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants