Skip to content

2.5.0: Collect-status, Harness.get_filesystem_root, Pebble service context

Compare
Choose a tag to compare
@benhoyt benhoyt released this 31 Jul 22:26
· 956 commits to main since this release
ca04872

This release includes three significant additions:

  1. Multi-status: An initial version of the much-discussed "multi-status" handling in the form of the new collect_app_status and collect_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 on CollectStatusEvent. PR #954.
  2. Harness.get_filesystem_root: Overhauling the Harness's test filesystem from an in-memory filesystem to use a temp directory on the real filesystem; use Harness.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.
  3. 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:

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