← Back to issue list

charmcraft should complain if the charm contains a bundle

View original Github issue

Metadata

Project
charmcraft
Number
#2233
Type
issue
State
open
Author
PietroPasotti
Labels
—
Created
Updated
Closed
—

Current evaluation

Feature request: charmcraft pack should error/warn when the produced charm contains a bundle.yaml, since juju deploy then deploys the bundle instead of the charm. Clear repro, but no maintainer triage or labels.

Suggested action: needs triage

Reason: The report gives an unambiguous repro (charmcraft init + add bundle.yaml + pack + juju deploy) and no equivalent guard exists in the codebase — grep for 'bundle.yaml' only finds charm/bundle name detection in charmcraft/application/commands/store.py, and the AdditionalFiles linter (charmcraft/linters.py) only flags files present in prime but not in stage, so a staged bundle.yaml passes silently. Bundle support was removed in Charmcraft 4 (commit 2cb4db71 / PR #2320, which only rejects 'type: bundle' projects) but that did not address stray bundle.yaml files. The issue has zero comments, no labels and no assignee, so it has never been assessed; it also leaves open whether this should be a hard error or a warning and at which stage (project root check vs. prime-dir check vs. linter).

Evaluated by: mr-cal-bot

Impact: 38 Quick Win: 19 Complexity: 30 Confidence: 72 Actionability: 70

Issue body

### Bug Description see: https://github.com/juju/juju/issues/19207#issuecomment-2750556513 TLDR: if you (accidentally) pack a 'bundle.yaml' file with your charm, juju will attempt to deploy the bundle instead of the charm when doing `juju deploy ./mycharm.charm` Juju seems to think this is a feature and won't fix it, but I think at least charmcraft should validate that there is no 'bundle.yaml' file in your charm root, as I can guarantee you in 101% of the cases it will lead to unwanted and unexpected and hilariously confusing results. ### To Reproduce charmcraft init create a bundle.yaml in your charm root, put there any bundle. charmcraft pack juju deploy mycharm.charm - bundle gets deployed, not your charm. ### Environment all ### charmcraft.yaml ```yaml n/a ``` ### Relevant log output ```shell n/a ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 38
Quick Win: 19
Complexity: 30
Confidence: 72
Actionability: 70
needs triage Feature request: charmcraft pack should error/warn when the produced charm contains a bundle.yaml, since juju deploy then deploys the bundle instead of the charm. Clear repro, but no maintainer triage or labels.
qwen/qwen3.6-35b-a3b
Impact: 60
Quick Win: 38
Complexity: 20
Confidence: 70
Actionability: 80
needs triage Feature request to add validation during charm packing to reject charms containing bundle.yaml, preventing accidental bundle deployment by juju.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 26
Staleness: 75
Complexity: 25
Confidence: 80
Support Request: 10
needs triage Request for charmcraft pack to warn or fail when a charm root contains a bundle.yaml, since juju then deploys the bundle instead of the charm. No labels, no maintainer response; validation still absent from current pack code.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 20
Confidence: 80
Support Request: 10
needs triage Request to add build-time validation in charmcraft to reject charms containing a bundle.yaml file, preventing accidental bundle deployment. Currently untriaged and inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 15
Confidence: 80
Support Request: 5
needs triage Request to add validation in charmcraft to error if bundle.yaml is present in the charm root, preventing accidental bundle deployment. Untriaged, zero comments, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 30
Confidence: 85
Support Request: 10
needs triage Feature request to add validation in charmcraft that rejects charms containing a bundle.yaml file to prevent accidental bundle deployment. Untriaged, zero comments, inactive for over a year.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#2320 (confidence 80%)

    PR 'feat!(bundle): remove bundle features' (commit 2cb4db71) removed bundle support in Charmcraft 4 and makes CharmcraftProject.unmarshal raise 'Support for type: bundle was removed in Charmcraft 4', but it does not validate charms that accidentally contain bundle.yaml.

  • Related To: juju#19207 (confidence 75%)

    Upstream juju discussion explicitly linked in the issue body; per the reporter, juju considers bundle.yaml detection when deploying a .charm a feature and declined to fix it, which is why the validation is requested in charmcraft.

  • Related To: canonical/charmcraft#1900 (confidence 60%)

    Open issue about the charm plugin including unexpected files in packed charms; same root area (stray source-tree files ending up in the charm), though that one is about source inclusion, not bundle.yaml specifically.

Related issues

Issue Project State Summary Similarity
#2341 Packing a bundle produces a zip that is rejected by charmhub charmcraft open Charmcraft 3.4.6 packs bundles with metadata.yaml instead of bundle.yaml, causing Charmhub rejection. Bundle features removed in Charmcraft 4.0; maintainer requested charmcraft.yaml with no response.
74%
#249 `charmcraft build` will let you build a charm that won't deploy charmcraft closed Closed by facundobatista as a duplicate, tracking all build-time sanity checks (incl. config.yaml/actions.yaml validity) in the umbrella issue charmcraft#27; later implemented by merged PR #556 (a585aec6).
71%
#1931 Successfully pack charm with incorrect charm.py file permission charmcraft open Packing accepts a non-executable src/charm.py, causing Juju to fail at deploy. The report has a clear reproducer but no maintainer triage or recorded fix.
70%
#851 charmcraft revisions <bundle> fails with "Name juju-qa-bundle-test not found in the charm namespace" charmcraft closed Closed without a code fix after the intermittent Charmhub lookup error could not be reproduced under Charmcraft 3; maintainers suspected a server-side glitch.
70%