2.5.0: Collect-status, Harness.get_filesystem_root, Pebble service context
This release includes three significant additions:
- Multi-status: An initial version of the much-discussed "multi-status" handling in the form of the new
collect_app_status
andcollect_unit_status
events. This is useful for letting the framework automatically evaluate application (or unit) status from various components of the charm. We'll be documenting this properly soon, but in the meantime, read the API reference docs onCollectStatusEvent
. PR #954. - Harness.get_filesystem_root: Overhauling the
Harness
's test filesystem from an in-memory filesystem to use a temp directory on the real filesystem; useHarness.get_filesystem_root
to get the temp filesystem directory for a specific container. This makes testing container filesystem operations significantly easier and allows tests to use the regular Python file APIs to interact with it. Thanks @weiiwang01 for his efforts on this in #960. - Service context: Added support for Pebble's new "service context" feature, to allow you to exec commands in the context of a specified service (where context means environment variables, working directory, and user/group). PR #957.
Other notable changes:
- Add
JujuVersion.supports_open_port_on_k8s
by @carlcsaposs-canonical in PR #965 - Support reading
charmcraft.yaml
in the testing harness by @syu-w in PR #977
In addition, the following developers made their first contribution:
- @paulomach in #975 (Add kill-delay to pebble ServiceDict type)
- @sobolevn in #978 (Replace typing.AnyStr with Union[str, bytes])
- @syu-w in #977 (Support reading charmcraft.yaml in testing harness)
We also made several other minor improvements to type annotations and a few other tweaks. See the full changelog: 2.4.1...2.5.0