feat: add debug juju action for enabling/disabling flavor#106
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a debug Juju action that enables operators to enable or disable flavors directly through the planner charm without requiring API calls.
Changes:
- Adds a new
update-flavorsubcommand to the planner binary that modifies flavor enabled/disabled state in the database - Implements a Juju action handler in the charm that invokes the planner subcommand
- Adds integration test coverage for the new action functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| cmd/planner/main.go | Implements update-flavor subcommand with flag parsing and database operations to enable/disable flavors |
| charms/planner-operator/src/charm.py | Adds action handler that executes the planner subcommand via subprocess |
| charms/planner-operator/charmcraft.yaml | Defines the update-flavor action schema with flavor and disable parameters |
| charms/tests/integration/test_planner.py | Adds integration test verifying the action correctly toggles flavor state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cbartz
left a comment
There was a problem hiding this comment.
TY! I think we should use the REST API, seems to make the code much simpler.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
florentianayuwono
left a comment
There was a problem hiding this comment.
review session from weii
yanksyoon
left a comment
There was a problem hiding this comment.
Would refactoring the planner client out help with charm code implementation and testing?
Thank you!
yanksyoon
left a comment
There was a problem hiding this comment.
Thank you for the changes, LGTM!
|
@yanksyoon I've opened a new pull request, #111, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Christopher Bartz <christopher.bartz@canonical.com>
Overview
Add a debug Juju action that enables operators to enable or disable flavors directly through the planner charm.
Rationale
So that operators can perform debugging.
Checklist
CONTRIBUTING.mdhas been updated upon changes to the contribution/development process (e.g. changes to the way tests are run)