Skip to content

Releases: canonical/operator

1.5.5: Backport "error" status fix to 1.5

25 Apr 12:42
5bbc50f
Compare
Choose a tag to compare

This releases the backport of the "error" status fix #875 to the 1.5-maintenance branch (PR #927).

2.2.0: Harness.add_network, simplified "import ops"

27 Mar 23:34
a8717ea
Compare
Choose a tag to compare

This is version 2.1.0 of ops, which includes the following changes:

Harness.add_network

In #846 we added Harness.add_network, which allows developers who write charm unit tests to easily add simulated data for the bind address and network information. This is a small but long-requested feature that will avoid charmers patching internal ops methods. Fixes #456.

Simplified way to import ops

In #910 we added a simplified way to import ops: it pulls most of the names in the various ops.foo sub-modules into the top-level ops module so that charmers don’t have to remember which sub-module each class comes from. This also makes the various ops classes more discoverable with an IDE’s autocomplete. Fixes #731.

Other minor changes

There are also a few other minor changes, including the addition of Layer.__eq__ to allow you to compare pebble.Layer objects with the == operator. See the full list of commits in this release.

2.1.1 (fixes install issues with 2.1.0)

01 Mar 02:10
530b55a
Compare
Choose a tag to compare

This patch release fixes issues with the missing requirements.txt file during pip install: #914.

2.1.0

28 Feb 23:23
34e5dfb
Compare
Choose a tag to compare

This is version 2.1.0 of ops, which includes the following changes:

Open-port support

We added Pythonic APIs to interface to the open-port, close-port, and opened-ports hook tools in PR #905. This allows charms to ask Juju to open ports in VM charms and in K8s sidecar charms (with some issues in the latter being fixed in juju/juju#15225). See the Unit.open_port() API reference.

Other minor changes

  • Use f-strings (almost) everywhere (#889)
  • Un-vendor websocket library (#891) -- thanks @tinvaan
  • A few minor tweaks now that we're on Python 3.8 (#890)
  • Define all dependences in requirements files (#894) -- thanks @tinvaan
  • Make testing pull() raise pebble.PathError and improve docs (#897)
  • Don't call secret-info-get with both ID and label (#900)
  • Add ops.lib deprecation notice (#901)
  • Add debug logging for custom events (#843) -- thanks @PietroPasotti
  • Replace "# type: T" comments with proper variable type annotations (#904)

View the full list of commits between 2.0.0 and 2.1.0.

2.0.0 final

25 Jan 00:52
b5cde98
Compare
Choose a tag to compare

This is version 2.0.0 of ops, which includes the following changes:

Major changes

  • APIs to interact with Juju Secrets, along with a testing harness. Read the tutorial or the code (#861).
  • Ops 2.0.0 requires Python 3.8+ (ops 1.5.x works down to Python 3.5). Note that Python 3.8 is the version installed by default on Ubuntu 20.04 (Focal), where Python 3.5 was installed on Ubuntu 16.04 (Xenial). As a result, ops 2.0.0 is intended for use with Juju 3.0+, which only supports Ubuntu 20.04 and above. We started using some Python 3.8 features in #871, and plan to use more in future ops 2.x releases.
  • Removed SIMULATE_CAN_CONNECT from the testing harness (#871). When we introduced can_connect it would have been a breaking change to enable it by default, so we added the SIMULATE_CAN_CONNECT global to enable it, with a warning that we'd enable it by default in a future release. This release removes the global flag and enables simulation by default.
  • Made begin_with_initial_hooks() trigger pebble-ready in the testing harness (#871). The default value of container.can_connect() is still False when using begin() ("manual mode"), but this release updates begin_with_initial_hooks() to set can_connect to True and fire pebble-ready for all containers in the charm's metadata.

Note that the SIMULATE_CAN_CONNECT and begin_with_initial_hooks() changes won't change or break your charms, however, they may break charm tests -- for example, tests that aren't expecting pebble-ready to be fired when calling begin_with_initial_hooks().

Other breaking changes

  • Deprecate controller storage: #882. This deprecate use_juju_for_storage=True (it's intended for pod-spec charms).
  • Remove Windows support: #872. Juju 3.0 no longer supports Windows deployments, so ops doesn't need to either.

Minor changes

  • Fix logging in can_connect, add tests; remove pebble.Error methods: #860. This fixes a couple of logging calls, but also removes the name() and message() methods from the ops.pebble.Error exception subclass. This is theoretically a breaking change, but it is very unlikely these methods were used by charms.
  • Add ErrorStatus #875. This adds a missing unit status value, error.
  • Add Pebble idempotency behavior #876. This makes the testing harness's emulated versions of start() and stop() match Pebble's current behaviour, which makes them idempotent: start() now does nothing if the service is already started, and similarly stop() does nothing if the service is already stopped.
  • Clarifies the warning message when local storage is chosen: "not a Kubernetes podspec charm" instead of "not a kubernetes charm" (the latter is incorrect). This was done in #882.
  • Removes the long-deprecated key argument to charm's __init__. This was done in #882.
  • Removes the deprecated (and private!) Harness._oci_resources attribute. This was done in #882.

2.0.0rc2

12 Jan 04:14
b5cde98
Compare
Choose a tag to compare
2.0.0rc2 Pre-release
Pre-release

This is a release candidate for the next major release of ops (2.0.0, which we plan to release late January). To try it in your charms, please update the ops line in your requirements.txt file to say:

ops==2.0.0rc2

For details of the changes since 1.x, see the 2.0.0 final release notes.

1.5.4

27 Nov 21:26
28251fa
Compare
Choose a tag to compare

This is a patch release with only a few minor changes, including:

See the full list of commits here.

The next release will likely be 2.0.0 with Juju secrets support, and switching from minimum Python version 3.5 to 3.8.

1.5.3

04 Oct 13:09
7b86957
Compare
Choose a tag to compare

What's Changed

This is a bug-fix/patch release for ops 1.5 advancing the Operator Framework in a number of key areas including:

Typing

Typing is now complete for all ops modules and static checks for all using pyright.

Documentation

Various documentation improvements.

Testing

The Harness now tries harder to behave like production code would.

Improved error reporting

  • Improved error message for invalid storage key usage by @rwcarlsen in #771
  • Better error for relation data access in relation-broken events by @rwcarlsen in #765
  • downgrade breaking-change exception to just a warning by @rwcarlsen in #822

Bugfixes

  • Fix incorrect kwarg handling in testing backend storage_list by @rwcarlsen in #820
  • Allow network-get to return hostnames where previously IPaddr were expected by @PietroPasotti in #823
  • Use --file for relation-set; avoid shell argument length limits by @rbarry82 in #805
  • Fixed bug in ops.Model where non-string keys could be used to write relation data by @PietroPasotti in #788

Misc

New Contributors

Full Changelog: 1.5.2...1.5.3

1.5.2

18 Aug 20:16
ac4dff6
Compare
Choose a tag to compare

This is a bug-fix/patch release for ops 1.5 addressing a few important issues including:

  • Fix harness model uuid to use the correct/current format used by juju (#782).
  • Include the missing departing unit attribute on relation-departed events when using the harness (#790).
  • Remove restrictive limits on the number and size of relation data items that can be set (#805).
  • Fix type annotations that were causing failures in Ubuntu xenial based environments - i.e. python 3.5 (#810).

Notably, this release was carefully crafted to not break your code. If it does - please complain loudly and we will address problems after completing a good, forceful facepalm.

1.5.1

18 Aug 18:56
Compare
Choose a tag to compare

This release mistakenly excluded one important bugfix. Please skip it - use 1.5.2 instead.