Ops 2.21.0, ops-tracing 2.21.0 and ops-scenario 7.21.0 Native tracing support in ops and support for Pebble identities
What's Changed
This release adds ops[tracing]
, the first-party tracing support for your charms, support for reading and setting Pebble identities and a change where a new instance of the charm class is used for each deferred event.
Potential gotchas
Due to canonical/charmcraft#2259, your charm may not build against 20.04 base, if you are using requirements.txt or other mechanism that enforces building all dependencies from source. Please wait for charmcraft 3.4 hot fix or migrate to the uv
plugin. The issue is not unique to ops
, however this release brings in a new dependency that is affected. If yours is a simple charm without complex charm libs, you may be able work around the issue by restricting your dependencies, like ops <= 2.20.0
.
Each deferred event is now run in a fresh instance of your charm class. The change should be safe for most charms, however, if your charm defers events and shares data between the deferred event and the current event in the charm class, please test thoroughly. The Ops pre-commit and commit events are also now emitted after each deferred event, so if you use those and defer, please check that it's safe to have them run more than once per hook.
Features
- Ops[tracing] (with a first-party charm lib) in #1612
- Pebble identities in #1672
- Run deferred events with fresh charm instances in #1631
Fixes
Documentation
- Add best practice note around using tooling provided by the charmcraft profile in #1700
- Clarify guidance about designing python modules in #1670
- Fix a bug in the k8s tutorial doc about unit test in #1688
- Fix broken link in readme in #1679
- Fix links to juju docs in #1681
- Fix tox command in hacking.md in #1661
- Improve landing page of kubernetes charm tutorial in #1660
CI
- Add zizmor to static check github workflows in #1656
- Change prerelease setting used to add latest ops and the testing API in #1682
- Don't pin release jobs to github environments in #1683
- Don't run tests within the publish job in #1684
- Fix smoke test in #1698
- Post-release versioning, release process update + workflow fix in #1658
- Rename "tox -e fmt" to "tox -e format" in #1668
Tests
- Fix overly specific test that fails sometimes with tracing in #1695
Full Changelog: 2.20.0...2.21.0