← Back to issue list

feat(profile): add example action to kubernetes and machine init profiles

View original Github issue

Metadata

Project
charmcraft
Number
#2813
Type
pull request
State
open
Author
tonyandrewmeyer
Labels
Created
Updated
Closed

Current evaluation

Adds example pause/resume actions to machine profile and restart action to kubernetes profile in charmcraft init templates. Approved by 4 reviewers, CI passing, 1 unresolved review comment.

Suggested action: needs review

Reason: The PR has 4 reviewer approvals and passing CI checks, indicating it is ready to land. The single unresolved review comment appears to be a minor question from @dwilding that doesn't block merging. The changes add example actions to init templates, which is a straightforward template update.

Impact: 50 Quick Win: 37.5 Staleness: 5 Complexity: 25 Confidence: 85

Issue body

Extends both the `kubernetes` and `machine` profiles so that `charmcraft init` scaffolds a working example action alongside the existing lifecycle hook code, with unit and integration tests for it. The profile is a strong signal to human and agentic charmers for best practices. Including an example of an action is concrete input without needing the charmer to go find documentation, or have that in training data (human or model). The actions here were chosen from what charms in the wild actually declare, rather than invented. Across ~400 charms that declare actions, `pause`/`resume` is by a wide margin the most common pair in machine charms, and `restart` is the most common workload-lifecycle action in Kubernetes charms once the copy-paste families are discounted. ### Changes Both profiles in `charmcraft.yaml.j2`: Adds an `actions:` block with links to the charmcraft and Juju reference docs, matching the style of the existing `config:` block. In the `machine` profile, `pause` and `resume`: `pause` stops the workload and leaves the unit deployed in maintenance status, so an operator can take a unit out of service without removing it; `resume` starts it again. `src/workload.py.j2` gains a `stop()` stub alongside the existing `install()` and `start()`. In the `kubernetes` profile, `restart`: Restarts the Pebble service in the workload container, waits for the workload to be ready, and sets the unit active again. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/charmcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [ ] ~I've added or updated any relevant documentation.~ - [ ] ~In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.~ - [x] I've updated the relevant release notes.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b
Impact: 50
Quick Win: 37.5
Staleness: 5
Complexity: 25
Confidence: 85
needs review Adds example pause/resume actions to machine profile and restart action to kubernetes profile in charmcraft init templates. Approved by 4 reviewers, CI passing, 1 unresolved review comment.
qwen3.6-35b-a3b-mtp-q6
Impact: 45
Quick Win: 33.75
Staleness: 45
Complexity: 25
Confidence: 75
needs review Adds example actions (pause/resume for machine, restart for kubernetes) to init profiles with unit and integration tests. Approved by 4 reviewers with 1 unresolved comment and failing CI checks.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 30
Confidence: 80
needs review Adds example pause/resume/restart actions to kubernetes and machine init profiles with tests. Approved by 4 reviewers, 1 unresolved comment, and CI has failing snap-build/test checks.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 40
Confidence: 85
needs review Adds example pause and resume actions for machine charms and restart for Kubernetes charms to charmcraft init profiles, including tests. Currently approved by three reviewers with one unresolved comment and pending CI checks.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 45
Confidence: 85
needs review Adds example pause/resume and restart actions to kubernetes and machine init profiles in charmcraft, including scaffolding code and tests. Approved by 3 reviewers with mostly passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 30
Confidence: 90
needs review Adds example pause/resume/restart actions to kubernetes and machine init profiles with tests. Approved by 2 reviewers, 1 unresolved comment, CI pending slow tests.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 25
Confidence: 85
needs review Adds example pause/resume actions to machine profiles and restart to kubernetes profiles in charmcraft init. Includes tests and doc links. Currently approved by two reviewers, has one unresolved comment, and is awaiting CI fixes.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 40
Confidence: 85
needs review Adds example pause/resume/restart actions to kubernetes and machine init profiles with tests. Approved by 2 reviewers, 4 unresolved comments, CI mostly passing except minimum dependencies test.
qwen/qwen3.6-35b-a3b
Staleness: 30
Complexity: 40
Confidence: 85
needs review Adds example lifecycle actions to charmcraft init profiles for machine and kubernetes, including tests and workload stubs. Currently approved by two reviewers but has four unresolved comments and a failing minimum dependencies CI check.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 35
Confidence: 85
needs review Adds example pause/resume and restart actions to kubernetes and machine init profiles in charmcraft, including tests. Currently approved by 2 reviewers with 4 unresolved comments, pending CI completion.
qwen/qwen3.6-35b-a3b
Staleness: 20
Complexity: 40
Confidence: 85
needs review Adds example pause/resume and restart actions to kubernetes and machine init profiles with tests. Approved by 2 reviewers but has 4 unresolved comments and pending CI checks.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 25
Confidence: 90
needs review Adds example pause/resume actions to machine and restart to kubernetes init profiles, including tests and workload stubs. Approved by two reviewers, pending CI and 4 unresolved comments.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 30
Confidence: 85
needs review Adds example pause/resume and restart actions to machine and kubernetes init profiles with tests. Approved by two reviewers but has 14 unresolved comments and failing CI checks for snap-build and lint.
qwen/qwen3.6-35b-a3b
Staleness: 25
Complexity: 20
Confidence: 85
needs review Adds example lifecycle actions (pause/resume for machine, restart for k8s) to charmcraft init profiles with tests. Approved by one reviewer but has 13 unresolved comments and failing CI checks for snap-build and lint.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 20
Confidence: 90
needs review Extends kubernetes and machine init profiles with example pause/resume and restart actions, including tests and workload stubs. Awaiting maintainer review with minor CI failures on snap-build and lint.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 20
Confidence: 90
needs review Adds example pause/resume and restart actions to kubernetes and machine init profiles, including tests and documentation links. Currently awaiting maintainer review with CI tests pending.

Update history

Date Change
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
created

Related issues

Issue Project State Summary Similarity
#2401 feat(test): add testing profiles for init command charmcraft merged Merged. Adds test-machine and test-kubernetes profiles to the init command for charmcraft test. Fixes #2365. Approved by three reviewers despite failing CI checks. Future updates will integrate jubilant and expand profiles.
71%