Charmcraft should validate all yaml files when building a charm
Metadata
Current evaluation
Malformed actions.yaml and config.yaml are now rejected during builds; PR #556 added Juju YAML linters in merge commit a585aec6.
Resolution: closed resolved
Reason: PR #556 added linters that parse actions.yaml and config.yaml during builds, implemented in commit 4f1e0190 and merged as a585aec6. This catches malformed YAML before deployment.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Yesterday i added a buggy action to our charms. This was the problematic part, in our `actions.yaml`:
```
foo:
title: 'Runs foo."
```
Charmcraft successfully built the charm. No warnings/errors given.
But when deploying a bundle that uses this charm, I got this message:
```bash
$ juju deploy ./bundle.yaml
ERROR cannot deploy bundle: yaml: line 60: found unexpected end of stream
```
Our CI was failing with the same message. I had no idea how to debug this. Our bundle has 30 lines, the error was on line 60 (?)...
Charmcraft should validate all charm files before building the charm. A message like `ERROR invalid actions.yaml` would be great.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Malformed actions.yaml and config.yaml are now rejected during builds; PR #556 added Juju YAML linters in merge commit a585aec6. | |
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft now validates actions.yaml and config.yaml during builds via merged PR #556 (a585aec6), preventing malformed YAML from reaching Juju. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved by implementing linters to validate config.yaml and actions.yaml as valid YAML during build. The initial fix only covered metadata.yaml, prompting a reopen until all charm YAML files were properly validated. | |
| qwen/qwen3.6-35b-a3b | — | — | Implemented YAML validation linters for config.yaml and actions.yaml during builds. Initially marked complete, the issue was reopened to ensure all charm YAML files are safely parsed, deferring content schema validation to a separate tracking issue. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. Reopened to address missing validation for config.yaml and actions.yaml. Resolution implements dedicated linters to verify YAML formatting during build and analyze commands, ensuring all charm files are validated before packaging. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Charmcraft now validates all YAML files during build. Dedicated linters were added for config.yaml and actions.yaml to ensure valid YAML syntax, addressing the initial gap and resolving the issue. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#556
(confidence 100%)
The merged PR added build-time YAML syntax validation for actions.yaml and config.yaml.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2723 fix: match Juju's action name validation rules | charmcraft | merged | Merged PR #2723 aligned Charmcraft’s action-name validation with Juju, rejecting underscores and correcting the documentation to describe the actual naming rules. | |
| #607 Add linter to check charm's categories | charmcraft | closed | Category validation was abandoned after metadata tags and categories were deprecated; Charmcraft would not inspect Juju YAML without official schemas. |