Migrate/auxiliary code#1769
Draft
marceloneppel wants to merge 9 commits into
Draft
Conversation
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>
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>
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
Solution
Checklist