Skip to content

feat: reactive support for 26.04#2678

Draft
sabaini wants to merge 1 commit intocanonical:mainfrom
sabaini:feat/reactive-26.04
Draft

feat: reactive support for 26.04#2678
sabaini wants to merge 1 commit intocanonical:mainfrom
sabaini:feat/reactive-26.04

Conversation

@sabaini
Copy link
Copy Markdown

@sabaini sabaini commented Apr 29, 2026

Enable reactive charms for 26.04


  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • I've successfully run make lint && make test.
  • I've added or updated any relevant documentation.
  • In documents I changed, I added a meta description if one was missing.
  • I've updated the relevant release notes.

Signed-off-by: Peter Sabaini <peter.sabaini@canonical.com>
def get_build_packages(self) -> set[str]:
"""Return a set of required packages to install in the build environment."""
return set()
return {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this new, or should this always have been this way?

craft_parts.plugins.plugins.get_plugin_class("charm")
with pytest.raises(ValueError, match="plugin not registered: 'reactive'"):

if charm_dir.name in {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rather than putting this conditional here, could you parametrize the match and which plugin is removed instead?

Copy link
Copy Markdown
Collaborator

@lengau lengau left a comment

Choose a reason for hiding this comment

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

Thanks for this! LGTM presuming the re-run of the Reactive plugin in https://github.com/canonical/charmcraft/actions/runs/25121675165/job/73846475235?pr=2678 succeeds, with one question for my own curiosity (that info predates me) and one requested test re-org.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Charmcraft to treat Ubuntu 26.04 (“resolute”) as a supported base for reactive charms, including dependency constraints, base/schema updates, plugin gating, and updated unit/integration/spread tests.

Changes:

  • Extend base/support constants and schema to include ubuntu@26.04, and adjust legacy plugin (charm/reactive) allow-lists accordingly.
  • Update plugin registration/validation so reactive remains available on 26.04 while charm is rejected on 26.04.
  • Update tests and spread smoke configuration to exercise reactive builds on 26.04.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Bumps craft-providers constraint to a newer supported range.
uv.lock Lockfile update matching the craft-providers constraint bump.
charmcraft/const.py Introduces separate base allow-lists for charm vs reactive; adds ubuntu@26.04 to supported bases and adjusts devel base list.
schema/charmcraft.json Adds ubuntu@26.04 into the enumerated base/build-base values.
charmcraft/application/main.py Updates app plugin gating logic to enable/disable charm and reactive plugins per build base set.
charmcraft/models/project.py Refactors validation for legacy plugin usage to check supported bases and provide more specific errors (e.g., charm plugin rejected on 26.04).
charmcraft/parts/plugins/_reactive.py Changes reactive plugin to declare additional build packages instead of none.
tests/unit/services/test_provider.py Adds ubuntu@26.04 to the provider base list used by unit tests.
tests/unit/parts/plugins/test_reactive.py Updates expected reactive plugin build packages.
tests/unit/models/test_project.py Updates/extends project model tests for 26.04 behavior and new error messaging.
tests/unit/models/test_charmcraft.py Adds parsing coverage for ubuntu@26.04 base strings.
tests/spread/smoketests/reactive/task.yaml Adds a resolute track; generates a 26.04-specific charmcraft.yaml for the reactive smoke test.
tests/spread/smoketests/reactive/reactivecharm/charmcraft.yaml Parameterizes base channel and adds reactive build arguments used by spread tests.
tests/integration/test_application.py Adjusts expectations for whether the reactive plugin is registered depending on the sample charm directory.
tests/integration/sample-charms/platforms-resolute-reactive/charmcraft.yaml New sample charm exercising reactive plugin on ubuntu@26.04.
tests/integration/sample-charms/platforms-resolute-reactive/expected.yaml Expected output for the new resolute reactive sample charm.
tests/integration/invalid-charms/resolute-reactive-plugin/charmcraft.yaml Removed: reactive plugin is no longer invalid on 26.04.
tests/integration/invalid-charms/resolute-reactive-plugin/errors.json Removed: corresponding expected error removed.
tests/integration/invalid-charms/resolute-charm-plugin/charmcraft.yaml Updates invalid charm definition for charm plugin on 26.04 (now single-base, updated metadata).
tests/integration/invalid-charms/resolute-charm-plugin/errors.json Updates expected error text to reflect charm-only rejection on 26.04.
tests/integration/invalid-charms/multibase-resolute-charm-plugin/charmcraft.yaml Updates invalid multi-base charm YAML for resolute charm-plugin case (naming and key formatting).
tests/integration/invalid-charms/multibase-resolute-charm-plugin/errors.json Updates expected error text to reflect charm-only rejection on 26.04.
tests/integration/invalid-charms/multibase-charm-plugin/errors.json Updates expected error text for mixed-base invalid legacy plugin usage.

Comment on lines +106 to +112
return {
"git",
"python3-pip",
"python3-setuptools",
"python3-venv",
"python3-wheel",
"virtualenv",
if invalid_bases := build_bases - const.CHARM_OR_REACTIVE_BASES:

if base := info.data.get("base"):
build_bases = {base}
Comment on lines +945 to +953
build_bases = {
str(info.build_base)
for info in craft_platforms.charm.get_platforms_charm_build_plan(
base=None,
platforms=pydantic.TypeAdapter(PlatformsDict).dump_python(
info.data["platforms"], mode="json", by_alias=True
),
)
}
Comment on lines 93 to +101
def test_get_build_package(plugin):
assert plugin.get_build_packages() == set()
assert plugin.get_build_packages() == {
"git",
"python3-pip",
"python3-setuptools",
"python3-venv",
"python3-wheel",
"virtualenv",
}
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.

3 participants