Add charm config for garm configurator#220
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds explicit charm configuration schema and validation for the garm-configurator charm, covering required OpenStack settings and GitHub App credentials (including Juju secret-backed values), and wires that validation into unit status reporting.
Changes:
- Adds new
charm_state.pymodule to parse/validate charm config and resolve Juju secrets, raising a structured error on misconfiguration. - Updates the charm to validate on
config-changedand report Active/Blocked viacollect-unit-status. - Expands charm config options in
charmcraft.yaml, addspydanticdependency, and significantly expands unit test coverage for validation cases.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
docs/changelog.md |
Adds a dated entry documenting the new charm configuration support. |
charms/garm-configurator/tox.toml |
Adds a fmt tox environment for isort + ruff format. |
charms/garm-configurator/tests/unit/test_charm.py |
Adds extensive validation/status tests for OpenStack + GitHub App config/secrets. |
charms/garm-configurator/src/charm.py |
Hooks config validation into events and reports unit status. |
charms/garm-configurator/src/charm_state.py |
Introduces config models + validation and secret resolution logic. |
charms/garm-configurator/requirements.txt |
Pins ops and adds pydantic. |
charms/garm-configurator/charmcraft.yaml |
Defines new config options (including secret-typed options). |
.gitignore |
Ignores .coverage artifact. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
yanksyoon
approved these changes
Jun 2, 2026
cbartz
approved these changes
Jun 2, 2026
florentianayuwono
approved these changes
Jun 2, 2026
Collaborator
florentianayuwono
left a comment
There was a problem hiding this comment.
lgtm tysm andrew!
auto-merge was automatically disabled
June 2, 2026 13:52
Head branch was pushed to by a user without write access
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.
What this PR does
Add charm configs for the garm configurator.
This includes the GitHub creds, and OpenStack creds/configs.
AI Summary
This pull request introduces robust configuration validation and state management to the
garm-configuratorcharm, ensuring that all required OpenStack and GitHub App settings are present and valid before the charm becomes active. It adds a newcharm_state.pymodule to encapsulate configuration logic, updates the charm to use this logic, expands the configuration schema, and adds comprehensive unit tests for all validation scenarios.Configuration and Validation Improvements:
charmcraft.yaml, including support for Juju secrets for sensitive values.charm_state.pymodule that defines strict validation logic for all configuration options and secrets, raising clear errors when misconfigured.charm.py) to validate configuration on every config change and set the unit's status to Blocked or Active accordingly. [1] [2]Testing Enhancements:
Dependency Updates:
pydanticas a dependency for configuration validation and downgradedopsto version 3.7.0 for compatibility.Why we need it
Part of the GARM charm feature set.
Checklist
CONTRIBUTING.mdhas been updated upon changes to the contribution/development process (e.g. changes to the way tests are run)docs/changelog.mdwith user-relevant changes(e.g., in
.github/workflows/integration_tests.yaml, ensure themoduleslist is correct)terraform fmtpasses andtflintreports no errors