Skip to content

feat: charm manifest & metadata#147

Merged
jujubot merged 3 commits intojuju:v6from
SimonRichardson:charm-metadata-manifest
Jul 26, 2024
Merged

feat: charm manifest & metadata#147
jujubot merged 3 commits intojuju:v6from
SimonRichardson:charm-metadata-manifest

Conversation

@SimonRichardson
Copy link
Copy Markdown
Member

@SimonRichardson SimonRichardson commented Jul 25, 2024

When migrating 3.6 to 4.0 we need to have the charm metadata and manifest upfront when importing an application. This is a requirement in order to keep RI (referential integrity) for the new SQL schema. The metadata and manifest are treated as an amorphous type, not as individual leaf types for every type of the metadata. This means when we want to rev the metadata it will be done at the root level (metadata and manifest only have a version).

Otherwise, the code is a replication of https://github.com/juju/juju/tree/main/internal/charm. Versioning of the charm will now impact model import/export. Changing the charm metadata is no longer free (probably never was, but always treated as such).


JIRA: JUJU-6411

To correctly have RI (referential integrity) when adding a application
in 4.0, we need to know the charm metadata. This essential metadata
is a requirement for things to be able to function correctly. We
don't need actions, config and lxd profiles, they can be supplied
when we upload the actual binary blob.

As this a deeply nested struct, I'm treating it as one amorphous blob,
as apposed to creating and setting each nested entity as it's own
thing.

The version will be the same for the whole of the metadata in it's
first implementation. Although each nested type has it's own schema,
so future iterations can update it independently from each other.
Copy link
Copy Markdown
Member

@manadart manadart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I know it's grind-work.

Following on with metadata, this adds the manifest as well to help
send information between the 3.6 model and a 4.0 model.
@SimonRichardson SimonRichardson force-pushed the charm-metadata-manifest branch from 27cba10 to d8d13b6 Compare July 26, 2024 10:31
To ensure that we don't get name collisions on the map, expose all
values. We don't need to optimise this path.
@SimonRichardson
Copy link
Copy Markdown
Member Author

/merge

@jujubot jujubot merged commit 45f57a3 into juju:v6 Jul 26, 2024
@SimonRichardson SimonRichardson deleted the charm-metadata-manifest branch July 26, 2024 15:03
jujubot added a commit that referenced this pull request Jul 29, 2024
…ta-manifest

#148

Cherry-pick of #147 to v7, to allow landing of 3.6 without bringing in #139

We can't land this into v6 as that is for main. So effectively, v6 branch is dead and we should never have cut a release for main against v6. The main branch is unfinished and we should have been just iterating on a hash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants