Skip to content

feat: scaffold garm-configurator charm (ISD-5732)#209

Open
florentianayuwono wants to merge 8 commits into
mainfrom
feat/gram-configurator-scaffold-isd-5732
Open

feat: scaffold garm-configurator charm (ISD-5732)#209
florentianayuwono wants to merge 8 commits into
mainfrom
feat/gram-configurator-scaffold-isd-5732

Conversation

@florentianayuwono
Copy link
Copy Markdown
Collaborator

@florentianayuwono florentianayuwono commented May 22, 2026

Summary

  • Adds charms/garm-configurator/ — a minimal K8S ops.CharmBase charm with no container, no relations, and no config options
  • Charm sets ActiveStatus("Ready") via collect_unit_status, reaching Active immediately on deploy
  • Unit tests use ops-scenario (Context/State API) — 3 tests covering install, config-changed, and collect-unit-status events
  • Integration test deploys the charm standalone and asserts Active status using jubilant
  • Wires garm-configurator-integration tox env in tox.ini and adds charm to CI lint/unit matrix

Acceptance Criteria

  • Charm deploys and reaches Active state with no relations wired
  • No functional relations or config options required for Active
  • Integration test verifies clean standalone deployment

Test Plan

  • tox -c tox.toml from charms/garm-configurator/ — all environments pass
  • Integration: tox -e garm-configurator-integration -- --charm-file=<built.charm> on a live K8S Juju model

Notes

ops==3.7.0 does not include Context/State in ops.testing — these live in the separate ops-scenario==8.7.0 package (from scenario import Context, State).

florentianayuwono and others added 4 commits May 22, 2026 19:42
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Charm deploys and reaches Active state with no relations or config.
Uses ops-scenario for unit testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator Author

@florentianayuwono florentianayuwono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review session from weii

Comment thread charms/garm-configurator/charmcraft.yaml
Comment thread charms/garm-configurator/pyproject.toml Outdated
florentianayuwono and others added 3 commits May 22, 2026 20:34
- Add missing parts section to charmcraft.yaml (fixes charmcraft
  validation error requiring at least 1 part)
- Replace pyright with mypy in pyproject.toml and tox.toml,
  matching platform-engineering-charm-template config
- Keep ubuntu@24.04 base; ubuntu@26.04 is not yet in charmcraft's
  supported bases (22.04, 24.04, 24.10, 25.04)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Expand ruff lint.select to include A, B, CPY, I, RUF, S, SIM, TC, UP
- Align lint.ignore with template
- Add lint.flake8-copyright, lint.pydocstyle.convention, target-version
- Add pythonpath to pytest options
- Expand codespell skip list
- Add [tool.bandit] config and bandit to static tox env

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@yanksyoon yanksyoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @florentianayuwono !

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR scaffolds a new Kubernetes charm, garm-configurator, intended to deploy standalone and immediately report ActiveStatus("Ready"), and wires it into the repo’s CI/unit/integration testing setup.

Changes:

  • Adds charms/garm-configurator/ with a minimal ops.CharmBase implementation that sets unit status via collect_unit_status.
  • Adds unit tests for the charm using ops-scenario and an integration test validating the charm becomes Active when deployed standalone.
  • Adds a dedicated tox integration environment and includes the new charm in the GitHub Actions charm lint/unit test matrix.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tox.ini Adds a dedicated garm-configurator-integration tox environment to run the new integration test.
charms/tests/integration/test_garm_configurator.py New integration test that deploys the charm and asserts it becomes Active.
charms/garm-configurator/src/charm.py Implements the minimal charm logic (sets ActiveStatus("Ready") via collect_unit_status).
charms/garm-configurator/tests/unit/test_charm.py Adds ops-scenario unit tests covering install/config-changed/collect-unit-status.
charms/garm-configurator/tox.toml Adds charm-local lint/static/unit/coverage tox configuration.
charms/garm-configurator/pyproject.toml Configures ruff/codespell/mypy/bandit/pytest/coverage for the new charm.
charms/garm-configurator/requirements.txt Pins ops==3.7.0 for the new charm.
charms/garm-configurator/charmcraft.yaml Defines charmcraft build metadata for the new charm.
.github/workflows/charms_lint_and_unit.yaml Adds charms/garm-configurator to the CI matrix.

Comment thread charms/garm-configurator/src/charm.py Outdated
Comment thread charms/tests/integration/test_garm_configurator.py Outdated
if not charm:
return None
if len(charm) > 1:
configurator_charms = [f for f in charm if "configurator" in f]
Comment thread charms/garm-configurator/tox.toml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants