Skip to content

Migrate/auxiliary code#1769

Draft
marceloneppel wants to merge 9 commits into
16/edgefrom
migrate/auxiliary-code
Draft

Migrate/auxiliary code#1769
marceloneppel wants to merge 9 commits into
16/edgefrom
migrate/auxiliary-code

Conversation

@marceloneppel

Copy link
Copy Markdown
Member

Issue

Solution

Checklist

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

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
The aux2-combined branch of the library introduces the modules required
by aux-flip (utils.arch, config.enums.Substrates, config.literals.PEER_RELATION,
config.locales.LOCALES, core.config.CharmConfig) and carries other
structural changes relative to the previously vendored version.

Bump vendored version to 16.2.4 to bust the charmcraft wheel cache.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Re-vendor skl-lib to 16.2.5 (contains PEER_RELATION and SNAP_USER).
Remove the PEER alias and SNAP_DAEMON_USER local definitions, repoint
all use-sites across src/ and tests/ to the canonical lib names.
Expand the re-export shim in constants.py to source APP_SCOPE,
BACKUP_USER, MONITORING_PASSWORD_KEY, PATRONI_PASSWORD_KEY,
PEER_RELATION, REPLICATION_PASSWORD_KEY, REWIND_PASSWORD_KEY,
SECRET_DELETED_LABEL, SECRET_INTERNAL_LABEL, SECRET_KEY_OVERRIDES,
SNAP_USER, SYSTEM_USERS_PASSWORD_CONFIG, UNIT_SCOPE, USER_PASSWORD_KEY
from the lib, while keeping RAFT_PASSWORD_KEY VM-local.

Avoids having two sources of truth for shared constant values and
ensures the charm picks up lib-side changes automatically.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Bumps the vendored postgresql-charms-single-kernel from 16.2.6 to
16.2.7, reflecting the migrate/integration branch of the library which
adds integration-test helpers. All 237 unit tests continue to pass
with no charm source changes.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…(VM)

Vendoring the lib in skl-lib/ with charmcraft build hacks is fragile and
couples the charm repo to the library source tree. Switch to a pinned GitHub
archive URL so the dependency is resolved through Poetry/pip like any other
package, removing the override-build cp hack and the --without-hashes export
arg from charmcraft.yaml.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel added the enhancement New feature, UI change, or workload upgrade label Jun 12, 2026
@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label Jun 12, 2026
Integration tests were importing constants via 'from constants import ...' (which eagerly imports
single_kernel_postgresql in its module body) and directly via 'from single_kernel_postgresql...
import'. The integration CI env runs 'poetry install --only integration --no-root' which does not
install the lib, causing ModuleNotFoundError at pytest collection time for every spread job.

Hardcode the needed constant values locally in each file, matching PR #1764's style, so no
integration file transitively imports the lib. One documented exception remains: test_charm.py
retains 'from single_kernel_postgresql.config.locales import LOCALES as SNAP_LOCALES' because it
asserts against a 510-entry locale list that cannot be practically hardcoded.

Signed-off-by: Marcelo Henrique Neppel <neppel2026@proton.me>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…brary

test_postgresql_locales asserted the deployed snap's locales against the
library's LOCALES Literal, which forced tests/integration/test_charm.py to
import single_kernel_postgresql at module scope. The integration dependency
group does not install the library, so that import failed at collection and
sank the entire test_charm.py spread job.

Commit the canonical list as tests/integration/locales.txt and read it from
the test instead, dropping the library import. A unit test asserts the
snapshot still matches the library's LOCALES so CI fails if they drift.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
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