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

charmcraft upload should allow a user to also release the charm #1979

Open
lucabello opened this issue Oct 31, 2024 · 3 comments
Open

charmcraft upload should allow a user to also release the charm #1979

lucabello opened this issue Oct 31, 2024 · 3 comments
Labels
Enhancement New feature or request triaged

Comments

@lucabello
Copy link

lucabello commented Oct 31, 2024

What needs to get done

Currently, to release a charm you have to:

charmcraft upload <.charm>  # note down the revision number
charmcraft upload-resource <resource>  # note down the revision number
charmcraft release ...

We should have a way to release a charm right after uploading it; the resource can be uploaded automatically according to the upstream-image field in charmcraft.yaml.

The approached discussed with @lengau would be to add --release=latest/edge flag to the upload command. Another option could be to introduce a new command that does both the update and release together.

An example would be something like:

`charmcraft upload prometheus.charm prometheus-k8s --resource=prometheus-image:ubuntu/prometheus:9 --release=latest/edge`

Why it needs to get done

In CI, releasing a charm currently translates to those three commands with weird parsing of the revision numbers, and the manual process is extremely error-prone.

@lucabello lucabello added the Enhancement New feature or request label Oct 31, 2024
@carlcsaposs-canonical
Copy link
Contributor

For the example, I think we'd need to specify the resource itself (i.e. an oci digest) instead of a resource revision, so that even if the resource changes, we can use a single command to upload & release the charm + oci image

@lengau lengau added the triaged label Jan 29, 2025
Copy link

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-4049.

This message was autogenerated

@simskij
Copy link
Member

simskij commented Feb 21, 2025

While we don't want to raise a PR for this, given that we have limited understanding of the starcraft internals, we have created a gap-closer in the meanwhile, that we are more than happy to get rid off once/if this makes it into charmcraft.

See the following lines for the gap-closer:

https://github.com/lucabello/noctua/blob/a2cf04f9b15dab2f68385f2498c949770bbb4d10/src/commands/charm.py#L86-L132

Executed through:

$ noctua charm release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request triaged
Projects
None yet
Development

No branches or pull requests

4 participants