Skip to content

Fix lint and unit tests after the 16/edge merge#144

Draft
marceloneppel wants to merge 2 commits into
refactor/start-and-installfrom
refactor/start-and-install-fix-lint-and-unit
Draft

Fix lint and unit tests after the 16/edge merge#144
marceloneppel wants to merge 2 commits into
refactor/start-and-installfrom
refactor/start-and-install-fix-lint-and-unit

Conversation

@marceloneppel

@marceloneppel marceloneppel commented Jun 9, 2026

Copy link
Copy Markdown
Member

Issue

After 16/edge was merged into refactor/start-and-install (already on the base branch), lint and the unit tests no longer passed: charm modules imported several undeclared dependencies, the K8s charm failed to instantiate, and ty reported type errors.

Solution

This PR is only the follow-up fixes on top of the already-merged base:

  • Declare the missing runtime deps in the postgresql extra (requests, tomli, charmlibs-snap, charmlibs-interfaces-tls-certificates, charm-refresh, pydantic) and regenerate uv.lock for them.
  • Fix the charm bugs the tests surfaced: implement K8sPaths.patroni_conf, observe charm.on.postgresql_pebble_ready, pass StatusObject.value to the status helpers, str() the path for _change_owner, and declare/load the status-detail action in the unit harness.
  • Clear all ty diagnostics (type manager state as CharmState, narrow peer_relation types) and apply ruff/codespell fixes.

tox -e lint, unit-vm (42 passed), and unit-k8s (43 passed) all pass.

Checklist

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

- deps: declare the runtime packages the charm imports but pyproject was
  missing (requests, tomli, charmlibs-snap,
  charmlibs-interfaces-tls-certificates, charm-refresh); regenerate uv.lock
- workload(k8s): implement the missing abstract K8sPaths.patroni_conf so the
  K8s charm can be instantiated
- events: observe charm.on.postgresql_pebble_ready (was self.on) and pass the
  StatusObject .value to add/remove_status_if_present
- managers(config): pass str(path) to _change_owner
- managers(base)/core: type manager state as CharmState and narrow
  peer_relation data_interface/unit so ty resolves their attributes
- test: declare the status-detail action and load actions.yaml in the unit
  harness so StatusHandler can observe it
- style: apply ruff fix/format, fix a codespell typo, and rename
  ErrorSettingSystemPassword to SettingSystemPasswordError

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…tive dep

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel changed the title Refactor/start and install fix lint and unit Merge 16/edge and fix lint and unit tests Jun 9, 2026
@marceloneppel marceloneppel changed the title Merge 16/edge and fix lint and unit tests Fix lint and unit tests after the 16/edge merge Jun 9, 2026
@marceloneppel marceloneppel mentioned this pull request Jun 10, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant