← Back to issue list

charmcraft doesn't support actions

View original Github issue

Metadata

Project
charmcraft
Number
#35
Type
issue
State
closed
Author
lourot
Labels
Created
Updated
Closed

Current evaluation

Resolved by PR #36, which updated charmcraft to correctly copy actions.yaml into packaged charms, fixing the AttributeError when using the ops framework.

Suggested action:

No scores available.

Issue body

See this simple hello-world charm with an action: https://github.com/AurelienLourot/charm-ops-with-action Without charmcraft it works but with charmcraft it fails with ``` 2020-06-16 09:57:36 ERROR juju-log Uncaught exception while in charm code: Traceback (most recent call last): File "/var/lib/juju/agents/unit-ops-with-action-0/charm/hooks/install", line 38, in <module> main(CharmOpsWithAction) File "lib/ops/main.py", line 313, in main charm = charm_class(framework) File "/var/lib/juju/agents/unit-ops-with-action-0/charm/hooks/install", line 30, in __init__ self.framework.observe(self.on.hello_action, self.on_hello_action) AttributeError: 'CharmEvents' object has no attribute 'hello_action' 2020-06-16 09:57:36 ERROR juju.worker.uniter.operation runhook.go:132 hook "install" failed: exit status 1 ``` This is apparently because charmcraft doesn't copy `actions.yaml` into the charm.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Resolved by PR #36, which updated charmcraft to correctly copy actions.yaml into packaged charms, fixing the AttributeError when using the ops framework.
qwen/qwen3.6-35b-a3b Resolved by merging PR #36, which fixed the packaging bug that prevented charmcraft from including actions.yaml and supporting Juju actions.
qwen/qwen3.6-35b-a3b Fixed by PR #36, which updated charmcraft to correctly package actions.yaml into built charms, resolving the missing action attribute error during hook execution.
qwen3.6-35b-a3b-mtp-q6 Resolved by PR #36, which updated charmcraft to properly copy actions.yaml into packaged charms, fixing the AttributeError when using the ops framework with actions.
qwen3.6-35b-a3b-mtp-q6 Resolved via PR #36. charmcraft now correctly copies actions.yaml into charms, fixing the AttributeError encountered when using the ops framework with actions.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#763 charmcraft V1.5.0 and V1.6.0 not bundling up bash actions charmcraft closed Closed as a duplicate. The charmcraft packaging bug omitting the bash actions directory was confirmed and is tracked in issue #764 for resolution.
76%
#36 'charmcraft build' should pull in actions.yaml and config.yaml charmcraft merged Merged after two reviewer approvals. The pull request implements automatic inclusion of actions.yaml and config.yaml during charmcraft builds, adding 80 lines across two files. Changes were successfully integrated.
73%
#1114 config: support use actions in charmcraft.yaml charmcraft merged Merged update allowing actions in charmcraft.yaml instead of separate actions.yaml. Includes refactoring to fix circular imports. Approved by one reviewer across 10 files with 345 additions and 3 deletions.
73%
#142 fix the action generated by 'charmcraft init' charmcraft merged Merged a fix for the action generated by charmcraft init, resolving issue #141. Approved by three reviewers and verified by the reporter. Corrects a generation bug in the init command.
72%
#31 feat: charmcraft actions craft-actions merged Merged changes adding two GitHub Actions: charmcraft/setup installs Charmcraft and LXD, while charmcraft/pack builds charms. Approved by two reviewers with passing CI checks, the update adds 299 lines across six files to streamline workflows.
71%