Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unified charmcraft.yaml #969

Closed
syu-w opened this issue Jul 11, 2023 · 6 comments · Fixed by #977
Closed

Support unified charmcraft.yaml #969

syu-w opened this issue Jul 11, 2023 · 6 comments · Fixed by #977

Comments

@syu-w
Copy link
Contributor

syu-w commented Jul 11, 2023

Hi,

charmcraft is now moving to use unified charmcraft.yaml for all metadata.yaml, actions.yaml, and config.yaml as specs in ST087. While the old style is still supported and we doing backward compatibility for now, the unit tests for the charms are not happy because it try to read metadata.yaml but did not found the metadata it needs.

So this might be a good time for ops to first try to read charmcraft.yaml to get metadata.

An example of the new unified charmcraft.yaml
https://github.com/canonical/charmcraft/blob/main/tests/test_metafiles.py#L29

@benhoyt
Copy link
Collaborator

benhoyt commented Jul 11, 2023

Thanks for the note @syu-w. If you or one of your team is able to help with a PR here, that would speed things up. Otherwise I'll try to get to this before the next release of ops (likely early August).

@syu-w
Copy link
Contributor Author

syu-w commented Jul 14, 2023

@benhoyt I am going to see if I can create a PR next week.

@syu-w
Copy link
Contributor Author

syu-w commented Jul 18, 2023

I have added a PR.

@benhoyt
Copy link
Collaborator

benhoyt commented Jul 19, 2023

I'm reviewing #977 now, but just wondering about the spec for this. ST087 doesn't seem to mention actions.yaml and config.yaml at all. It looks like the things in actions.yaml are included under an actions key in charmcraft.yaml, and the options from config.yaml are included directly. Is that correct? Is there a spec / doc for that somewhere?

@jnsgruk
Copy link
Member

jnsgruk commented Jul 19, 2023

@benhoyt the intention is this:

  • You can still include a metadata.yaml, but fields that appear in both charmcraft.yaml and metadata.yaml will cause a build error
  • You can still include a config.yaml seperately, or you can add options: in the charmcraft.yaml. This allows for splitting things out in charms with a lot of config options
  • You can still include actions.yaml or you can add actions: to your charmcraft.yaml

@benhoyt
Copy link
Collaborator

benhoyt commented Jul 24, 2023

Thanks for the PR, @syu-w -- merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants