yaml validation errors are not helpful if the file is empty
Metadata
Current evaluation
Charmcraft gives only a generic metadata.yaml validity error for empty or comment-only files; the acknowledged UX gap remains open
Suggested action: keep open
Reason: In preprocess.add_metadata, safe_yaml_load returns None for the comment-only/empty file and raises only "Invalid file: 'metadata.yaml'"; tests/unit/test_preprocess.py covers this input but expects the unhelpful message. lengau explicitly acknowledged the report and left it open, so this valid, localized diagnostics improvement should remain open.
Evaluated by: mr-cal-bot
Impact:
30
Quick Win:
22
Complexity:
17
Confidence:
94
Actionability:
90
Issue body
### Bug Description
validation error is not helpful on an empty file.
(it was actually hard to find out that the file was empty because I thought I'd deleted it). The project already had a (valid) charmcraft.yaml next to it, and couldn't figure out why charmcraft wasn't liking it.
### To Reproduce
charmcraft pack
### Environment
charmcraft 3.2.2
### metadata.yaml
```yaml
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
```
### Relevant log output
```shell
❯ charmcraft pack
Invalid file: 'metadata.yaml'
Recommended resolution: Ensure metadata.yaml meets the juju metadata.yaml specification.
For more information, check out: https://juju.is/docs/sdk/metadata-yaml
Full execution log: '/home/pietro/.local/state/charmcraft/log/charmcraft-20250110-134846.839621.log'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
30
Quick Win:
22
Complexity:
17
Confidence:
94
Actionability:
90
|
keep open | Charmcraft gives only a generic metadata.yaml validity error for empty or comment-only files; the acknowledged UX gap remains open | |
| qwen/qwen3.6-35b-a3b |
Impact:
30
Quick Win:
19
Complexity:
20
Confidence:
85
Actionability:
80
|
keep open | Empty or comment-only metadata.yaml produces unhelpful error message instead of indicating the file is empty. | |
| qwen/qwen3.8-27b |
Impact:
25
Quick Win:
21
Staleness:
70
Complexity:
15
Confidence:
85
Support Request:
10
|
keep open | charmcraft pack gives a generic 'Invalid file: metadata.yaml' error when the file is empty (comments only), making it hard to diagnose. A maintainer acknowledged it in June 2025 and left it open as low priority; the error is still generic in current code. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
55
Complexity:
20
Confidence:
90
Support Request:
10
|
keep open | Empty YAML files produce unhelpful validation errors in charmcraft. Reported as a bug, acknowledged by a maintainer, but currently unassigned and waiting for community contribution. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
80
Complexity:
20
Confidence:
85
Support Request:
10
|
keep open | Unhelpful validation error when metadata.yaml is empty. Acknowledged by maintainers but marked low priority with no engineering time allocated. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
75
Complexity:
15
Confidence:
85
Support Request:
10
|
keep open | Unhelpful validation error for empty YAML files. Maintainer acknowledged and left open as low priority. |
Update history
No update history recorded yet.
Related issues
No related issues found above the similarity threshold.