Skip to content

refactor(observers): use the observers module from the single kernel library - #1940

Draft
marceloneppel wants to merge 1 commit into
16/edgefrom
observers-vm-charm-migration
Draft

refactor(observers): use the observers module from the single kernel library#1940
marceloneppel wants to merge 1 commit into
16/edgefrom
observers-vm-charm-migration

Conversation

@marceloneppel

Copy link
Copy Markdown
Member

Issue

Follows the observers module migration into the single kernel library (postgresql-single-kernel-library #258-#263).

Solution

The charm drops its own cluster topology observer module, the cluster_topology_observer / raft_observer scripts, and the raft-observer systemd templates in favour of the library's substrate observers and package-shipped scripts, ported from the VM and K8s implementations. The charm keeps the event wiring and its _on_cluster_topology_change / _on_raft_reconnect / _on_databases_change handlers; the observer is now constructed with the charm state and the JUJU_EXECUTABLE literal instead of a magic string.

The library dependency is pinned to the migration head via its GitHub archive tarball (url = ".../archive/.tar.gz"), which pip hash-verifies like any sdist, so charm builds stay reproducible. Draft pin: flips to the released PyPI version before review.

The charm-side script tests moved into the library stack (#261); the handler tests stay and now patch the library state (peer_relation/peer_members_ips) the handler reads instead of the dropped charm properties.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

…library

The charm drops its own cluster topology observer module, observer
scripts, and raft-observer systemd templates in favour of the library's
observer handlers and package-shipped scripts, ported from the VM and
K8s implementations (postgresql-single-kernel-library #258-#263). The
charm keeps the event wiring and its _on_cluster_topology_change /
_on_raft_reconnect / _on_databases_change handlers, and the observer is
now constructed with the charm state and the JUJU_EXECUTABLE literal
instead of a magic string; the library dependency is pinned to the
migration head via its GitHub archive tarball, which pip hash-verifies
like any sdist, so charm builds stay reproducible. Draft pin; flips to
the released PyPI version before review.

The charm-side script tests moved into the library stack (4/6); the
handler tests stay and now patch the library state
(peer_relation/peer_members_ips) the handler reads instead of the
dropped charm properties.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel
marceloneppel force-pushed the observers-vm-charm-migration branch from a8d27d0 to 4b775cf Compare September 4, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, UI change, or workload upgrade Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant