feat(charmlibs): warn of deprecation on all charmlibs commands - #2691
Conversation
Warns about the deprecation of charmhub-hosted charmlibs in all charmlibs-related commands.
|
@tonyandrewmeyer @james-garner-canonical pls review |
|
Type checking with Command output |
|
Type checking with Command output |
There was a problem hiding this comment.
Pull request overview
Adds a user-visible deprecation notice for Charmhub-hosted charm libraries across the “Store (libraries)” command set, ensuring users see the warning regardless of which charmlibs-related subcommand they run.
Changes:
- Introduces a shared
CHARMLIBS_DEPRECATION_WARNINGmessage and_emit_charmlibs_deprecation_warning()helper instore.py. - Emits the warning at the start of
create-lib,publish-lib,fetch-lib,fetch-libs, andlist-lib. - Updates unit and integration tests to assert the warning is emitted.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| charmcraft/application/commands/store.py | Adds a shared deprecation warning constant/helper and emits it in all charmlibs-related commands. |
| tests/unit/commands/test_store.py | Adds/updates unit tests to assert the deprecation warning is emitted by relevant commands. |
| tests/integration/commands/test_store_commands.py | Updates fetch-lib integration test to assert the deprecation warning is emitted. |
|
Thanks! @james-garner-canonical will create page that we should point to. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
|
Type checking with Command output |
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
Co-authored-by: James Garner <james.garner@canonical.com> Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
This PR adds a docs page about the upcoming deprecation of the Charmhub-hosted library machinery. This page will be pointed to from all `charmcraft` library operations in an upcoming Charmcraft release (canonical/charmcraft#2691). Due to the upcoming docs migration, I suggest we stick with the `ubu.link` approach suggested by Alex. So Charmcraft will show `https://ubu.link/charmhub-libraries-deprecation`, linking to `https://documentation.ubuntu.com/charmlibs/explanation/charmhub-libraries-deprecation/`. When we migrate the docs, we can delete the `ubu.link` and recreate it pointing to the new location. --------- Co-authored-by: Dave Wilding <tech@dpw.me>
james-garner-canonical
left a comment
There was a problem hiding this comment.
The docs page is now live, pointed to by https://ubu.link/charmhub-libraries-deprecation
I believe this PR should now be good to merge and include in the next Charmcraft release 😀
Thanks @lengau!
Co-authored-by: Imani Pelton <imani.pelton@canonical.com> Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
mr-cal
left a comment
There was a problem hiding this comment.
Test/linter failures notwithstanding, the changes look good.
| ) | ||
| FetchLibCommand(config).run(args) | ||
|
|
||
| emitter.assert_progress(CHARMLIBS_DEPRECATION_WARNING, permanent=True) |
There was a problem hiding this comment.
I think these need to be assert_warning?
This PR adds a docs page about the upcoming deprecation of the Charmhub-hosted library machinery. This page will be pointed to from all `charmcraft` library operations in an upcoming Charmcraft release (canonical/charmcraft#2691). Due to the upcoming docs migration, I suggest we stick with the `ubu.link` approach suggested by Alex. So Charmcraft will show `https://ubu.link/charmhub-libraries-deprecation`, linking to `https://documentation.ubuntu.com/charmlibs/explanation/charmhub-libraries-deprecation/`. When we migrate the docs, we can delete the `ubu.link` and recreate it pointing to the new location. --------- Co-authored-by: Dave Wilding <tech@dpw.me>
Warns about the deprecation of charmhub-hosted charmlibs in all charmlibs-related commands.
make lint && make test.