-
Notifications
You must be signed in to change notification settings - Fork 20
feat(Lifecycle): select plugin groups #978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add `dev-resolute` dependency group to allow development on Ubuntu Resolute, with `python-apt` version pinned to `3.0.0`.
This adds the ability to choose plugin groups to the Lifecycle service. This works differently from the default plugin setup in the Application, which is now deprecated in favour of this. Apps that move over will be rewarded with a happy fuzzy feeling and the ability to get the plugin group based simply on the BuildInfo object.
pyproject.toml
Outdated
| "craft-grammar>=2.3.0", | ||
| "craft-parts>=2.26.0", | ||
| #"craft-parts>=2.26.0", | ||
| "craft-parts @ git+https://github.com/canonical/craft-parts.git@main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a craft-parts release before merge.
2aa2065 to
9a1b84b
Compare
|
|
||
| Testing | ||
| ======= | ||
| Testing with pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just so that the pre-commit hooks stop complaining because the ======= looked like a merge conflict.
There was a problem hiding this 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 introduces plugin group selection capability to the Lifecycle service, allowing applications to dynamically choose plugin sets based on BuildInfo. This deprecates the previous Application-based plugin registration approach in favor of a more flexible, build-specific plugin configuration system.
- Adds
get_plugin_group()method to LifecycleService for dynamic plugin selection based on BuildInfo - Implements witchcraft-specific plugin groups (MERLIN for Ubuntu ≤22.04 with Python, MORGANA for Ubuntu >22.04 with Rust)
- Deprecates Application.register_plugins() with a warning directing users to the new Lifecycle service approach
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| witchcraft/services/lifecycle.py | New lifecycle service implementation with plugin group selection logic for witchcraft |
| witchcraft/services/init.py | Registers the custom lifecycle service with the ServiceFactory |
| craft_application/services/lifecycle.py | Adds base get_plugin_group() method and plugin group setup logic in LifecycleService |
| craft_application/application.py | Adds deprecation warning to register_plugins() method |
| tests/integration/services/test_lifecycle.py | Adds integration test for plugin group setup with different plugin configurations |
| tests/spread/witchcraft/plugin-groups/ | Adds spread tests validating plugin group behavior on Ubuntu 22.04 and 24.04 |
| pyproject.toml | Updates craft-parts dependency to git source (temporary development dependency) |
| uv.lock | Updates lockfile to reflect git-based craft-parts dependency |
| docs/reference/services/lifecycle.rst | New documentation page for LifecycleService |
| docs/reference/services/index.rst | Adds lifecycle service to documentation index |
| docs/reference/changelog.rst | Documents new feature and deprecation in 6.1.0 changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
smethnani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit re the warning message but the rest looks good to me. Thanks @lengau!
Co-authored-by: Michael DuBelko <michael.dubelko@canonical.com> Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
This updates distro-support so that Ubuntu 26.04 (resolute raccoon) is included when testing.
jahn-junior
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Consider my suggestions optional :)
Co-authored-by: JJ Coldiron <jj.coldiron@canonical.com> Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
cmatsuoka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
5861a46 to
8d3e4f4
Compare
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
8d3e4f4 to
49c906f
Compare
| @@ -0,0 +1,21 @@ | |||
| .. _reference-LifecycleService: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's cleaner if we put this right before the H1. The meta directive should be the first thing on the page.
| .. _reference-LifecycleService: | ||
|
|
||
| .. meta:: | ||
| :description: API reference for the LifecycleService. In a craft application, the LifecycleService handles interactions with Craft Parts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
make lint && make test?docs/reference/changelog.rst)?This adds the ability to choose plugin groups to the Lifecycle service.
This works differently from the default plugin setup in the Application,
which is now deprecated in favour of this. Apps that move over will be
rewarded with a happy fuzzy feeling and the ability to get the plugin
group based simply on the BuildInfo object.
Fixes #966 CRAFT-4933