`name` field missing from packed charm's `metadata.yaml` when defined in `charmcraft.yaml` alongside a separate `metadata.yaml`
Metadata
Current evaluation
Charmcraft 4.0.1 packs a metadata.yaml without the `name` field when `name` is defined in charmcraft.yaml and a separate metadata.yaml (lacking `name`) exists, making the charm undeployable in Juju. Confirmed by a second user; no maintainer response yet.
Suggested action: needs triage
Reason: No labels, no assignee, and no maintainer response — only a second user (@gfouillet) confirming the bug on 2026-05-05. The code path is visible: preprocess.add_metadata only migrates fields in METADATA_YAML_MIGRATE_FIELDS from metadata.yaml into charmcraft.yaml, and PackageService._write_file_or_object copies the source metadata.yaml verbatim when it exists, so a `name` defined only in charmcraft.yaml is never written into the packed metadata.yaml. This is a real, reproducible, app-breaking bug (Juju rejects the charm) affecting any project using the legacy split-file layout, so it needs triage and a fix rather than closure.
Issue body
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.8-27b |
Impact:
80
Quick Win:
36.0
Staleness:
45
Complexity:
55
Confidence:
75
Support Request:
5
|
needs triage | Charmcraft 4.0.1 packs a metadata.yaml without the `name` field when `name` is defined in charmcraft.yaml and a separate metadata.yaml (lacking `name`) exists, making the charm undeployable in Juju. Confirmed by a second user; no maintainer response yet. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
50
Complexity:
35
Confidence:
85
Support Request:
5
|
needs triage | Packing a charm with a separate metadata.yaml omits the name field when defined only in charmcraft.yaml, breaking deployment. Unlabelled and awaiting maintainer triage. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
45
Complexity:
35
Confidence:
85
Support Request:
5
|
needs triage | charmcraft pack omits the name field from metadata.yaml when name is defined in charmcraft.yaml but missing from a separate metadata.yaml, causing Juju deployment failures. Currently unlabelled and awaiting maintainer review. | |
| qwen3.6-35b-moe-q4 |
Staleness:
45
Complexity:
40
Confidence:
90
Support Request:
5
|
needs triage | Charmcraft pack omits the name field from the generated metadata.yaml when it is defined in charmcraft.yaml but missing from a separate metadata.yaml, causing Juju deployment failures. Currently unlabelled and awaiting maintainer triage. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
45
Complexity:
25
Confidence:
90
Support Request:
5
|
needs triage | charmcraft 4.0 fails to merge the name field from charmcraft.yaml into a separate metadata.yaml during packing, producing undeployable charms. Confirmed by another user. Open, untriaged, last activity 41 days ago. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1530 Changing charmcraft.yaml doesn't update the resulting charm's metadata.yaml | charmcraft | open | Bug: editing charmcraft.yaml then re-running `charmcraft pack` does not update the resulting charm's metadata.yaml. Filed by a maintainer (lengau); last comment (2024-09-09) says it's unclear if still reproducible. Related open craft-application#821 describes the same 'Already packed' skip behavior. |