[DPE-10491] build(deps): bump single-kernel library to 16.3.0#49
Merged
Conversation
postgresql-charms-single-kernel 16.3.0 is now the released version, and it relocated `Substrates` from `config.literals` to `config.enums` and dropped `PEER` from the lib's public literals. The watcher must track that release to stay deployable: pinned to 16.2.2 its imports resolve, but built against the published 16.3.0 every hook crashes at import time. Bumping in lockstep keeps the charm installable on the same lib revision the rest of the PostgreSQL charms now consume. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
1 task
PATRONI_CLUSTER_STATUS_ENDPOINT and WATCHER_RELATION are identical to the lib's literals and used only in runtime modules (not the lib-less integration-test path), so import them from single_kernel_postgresql.config.literals instead of redefining them locally. Drop the dead API_REQUEST_TIMEOUT/SNAP_NAME/SNAP_CHANNEL. PEER, RAFT_PARTNER_PREFIX, RAFT_PORT, and SNAP_COMMON_PATH stay local: the integration tests import constants.py without the lib installed, so it must remain lib-import-free. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
The lib exposes the peer-relation name as PEER_RELATION ("database-peers"); the watcher redefined the same string locally as PEER. Drop the local PEER and import PEER_RELATION from single_kernel_postgresql.config.literals in charm.py and the integration tests, so the peer-relation name has one canonical source. To make the lib importable in the lib-less integration env, move the single-kernel dependency into a dedicated poetry group (mirroring the postgresql charm PRs) and add it to the unit/integration tox envs and the charmcraft export. The value is unchanged, so secret labels and the peer-relation lookup are unaffected.
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
The integration tox env was changed to `poetry install --only integration,single-kernel`, which installs postgresql-charms-single-kernel with its `postgresql` extra. That extra requires source `psycopg2`, which publishes no Linux wheels and therefore compiles from source, needing `pg_config`. The ubuntu-24.04-arm CI runners do not ship `pg_config`, so every arm64 integration job failed at dependency installation with `pg_config executable not found`, before any charm was deployed; the amd64 jobs passed only because their runner image bundles PostgreSQL. The 16.2.2 -> 16.3.0 bump itself is not the cause. Integration tests only consume the lib's pure-stdlib config.literals (PEER_RELATION) plus the `psycopg2` module already provided by `psycopg2-binary` (which has an aarch64 wheel); they never touch the extra's runtime dependencies. Keep the `postgresql` extra in the single-kernel group, which the unit env and the charmcraft poetry export still need (the charm imports single_kernel_postgresql.utils, which pulls httpx), and depend on the bare lib in the integration group so arm64 no longer builds psycopg2 from source. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
16/edge advanced with renovate updates (pytest bump, lock-file maintenance, GitHub Actions and charmcraft build-tool bumps) that diverged from this branch's single-kernel 16.3.0 work, leaving pyproject.toml and poetry.lock conflicting. Adopt the newer pytest pin, keep the single-kernel integration dependency, and regenerate the lock so the branch merges into 16/edge again. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
The comment claimed the postgresql extra "fails on arm64 runners", but the extra pulls psycopg2 from source, which needs pg_config and a C toolchain to build on any architecture -- it is not an arm64-specific limitation. State the reason as the source-build dependency it actually is, so it is not mistaken for an architecture quirk. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
The library was declared twice -- with the postgresql extra in the single-kernel group (the charm build needs the extra's runtime deps) and again without it in the integration group (which must not pull the extra's source psycopg2). Poetry activates an extra for every install scope selecting a group that carries it, so the two forms could not be merged directly. Pin the library once, bare, in the single-kernel group; declare the extra's runtime deps the build needs (charmlibs-pathops, charmlibs-rollingops, charmlibs-interfaces-tls-certificates, data-platform-helpers, httpx, tomli) in the build-only charm-libs group; and install the shared single-kernel group in the integration env instead of re-declaring the library. The charm build closure is unchanged and integration still avoids source psycopg2. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
dragomirp
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
postgresql-charms-single-kernel16.3.0 is the current published release. It introduces breaking API changes vs 16.2.x:Substratesmoved fromconfig.literalstoconfig.enums, andPEERwas removed from the lib'sconfig.literals(renamedPEER_RELATION).The watcher was pinned to
16.2.2. Left as-is, every hook crashes at import time against the published lib, so the charm cannot run on the same lib revision the rest of the PostgreSQL charms now consume.Solution
16.3.0and relockpoetry.lock.Substratesfromsingle_kernel_postgresql.config.enums(moved out ofconfig.literals) insrc/charm.py,src/raft_controller.py,src/relations/watcher_requirer.py, andtests/unit/test_raft_controller.py.PEER_RELATION(replacing the charm's localPEER) — and drop the now-redundant copies fromsrc/constants.py.single-kernelgroup. The charm build's required runtime deps from the lib'spostgresqlextra (charmlibs-pathops,charmlibs-rollingops,charmlibs-interfaces-tls-certificates,data-platform-helpers,httpx,tomli) are declared in the build-onlycharm-libsgroup; the integration env installs the sharedsingle-kernelgroup (its tests only import the lib's pure-stdlibconfig.literals) and usespsycopg2-binary, so it never builds the sourcepsycopg2the extra would pull in.No runtime behaviour change — the edits realign imports with the new lib layout and restructure dependency declarations (the charm-build dependency closure is unchanged).
Checklist