Skip to content

chore: migrate systemd library to charmlibs - #765

Open
Thanhphan1147 wants to merge 9 commits into
mainfrom
houston/ISD-7721
Open

Thanhphan1147 wants to merge 9 commits into
mainfrom
houston/ISD-7721

Conversation

@Thanhphan1147

Copy link
Copy Markdown
Collaborator

What this PR does

Migrates the systemd library from the deprecated Charmhub-hosted charms.operator_libs_linux.v1.systemd to the charmlibs-systemd package, matching the earlier apt/tls charmlibs migration.

  • Replaces from charms.operator_libs_linux.v1 import systemd with from charmlibs import systemd in haproxy-operator/src/haproxy.py.
  • Adds charmlibs-systemd~=1.0 to haproxy-operator/pyproject.toml and updates uv.lock.
  • Updates the systemd mock paths in haproxy-operator/tests/unit/conftest.py.
  • Removes the vendored haproxy-operator/lib/charms/operator_libs_linux/v1/systemd.py and the operator_libs_linux.systemd entry from charmcraft.yaml.

Why we need it

The Charmhub-hosted systemd library is deprecated in favour of charmlibs.systemd. ISD-7721 tracks completing this migration across the haproxy charm.

Test plan

  • tox -e lint in haproxy-operator/ (codespell, ruff format/check, mypy) - passed.
  • tox -e unit in haproxy-operator/ - 368 passed.
  • tox -e static in haproxy-operator/ (bandit) - no issues.
  • charmcraft pack --destructive-mode was attempted on the shared test VM but the VM runs Ubuntu 26.04 while the charm targets Ubuntu 24.04, so the build cannot run there.

Review focus

  • Confirm charmlibs-systemd~=1.0 is the intended dependency constraint.
  • The systemd API used by haproxy.py is unchanged between the vendored library and charmlibs.systemd.

Potential breaking changes

None; no user-facing behaviour changed.

New dependencies

  • charmlibs-systemd~=1.0 (replaces the vendored Charmhub systemd library).

Checklist

  • I followed the contributing guide
  • I added or updated the documentation (if applicable)
  • I updated docs/changelog.md with user-relevant changes
  • I added a change artifact for user-relevant changes in docs/release-notes/artifacts (internal change)
  • I used AI to assist with preparing this PR
  • I added or updated tests as needed (unit and integration)
  • If integration test modules are used: I updated the workflow configuration (not applicable)
  • If this PR involves a Grafana dashboard: not applicable
  • If this PR involves Terraform: not applicable

Thanhphan1147 added a commit that referenced this pull request Dec 3, 2026
@Thanhphan1147
Thanhphan1147 marked this pull request as ready for review December 4, 2026 12:35
@Thanhphan1147
Thanhphan1147 requested a review from a team as a code owner December 4, 2026 12:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant