fix: match Juju's action name validation rules
Metadata
Current evaluation
Merged PR #2723 aligned Charmcraft’s action-name validation with Juju, rejecting underscores and correcting the documentation to describe the actual naming rules.
Resolution: closed resolved
Reason: PR #2723 was approved and merged. It copied Juju’s action-name validation into Charmcraft, connected the validation to project loading, and corrected the related documentation.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The documentation implies that a Juju action name may contain underscores, but [that is not the case](https://github.com/juju/charm/blob/v12/actions.go#L20), and Juju will refuse to deploy a charm that does have one. This PR updates the documentation to be clearer what the real rules are.
It's also better for charmcraft to fail rather than Juju, so the Juju regular expression is also copied over to the charmcraft validation. Also, the validation wasn't hooked up, even though other fields (like name) are, which seems like a bug, so adjusted that too.
---
- [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`.
- [x] I've added or updated any relevant documentation.
- [x] 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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2723 aligned Charmcraft’s action-name validation with Juju, rejecting underscores and correcting the documentation to describe the actual naming rules. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2723 aligned action-name validation with Juju, rejecting underscores and correcting the documentation to describe the actual naming rules. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Updated documentation and implemented missing validation to align charmcraft action name rules with Juju's regex, explicitly disallowing underscores. Approved by reviewers and integrated after passing CI checks. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #310 Charmcraft should validate all yaml files when building a charm | charmcraft | closed | Malformed actions.yaml and config.yaml are now rejected during builds; PR #556 added Juju YAML linters in merge commit a585aec6. | |
| #2135 Docs: Broken references to Juju | charmcraft | closed | Fixed by merged PR charmcraft#2136 in commit fe64df47, correcting six broken Juju documentation references across four files. |