Comment 6 for bug 2034206

Revision history for this message
John A Meinel (jameinel) wrote :

Charmstore used to generate the .zip that is a charm "on the fly" and would populate it with its revision information.
It is not possible to populate that value without the stores knowledge (because charmcraft itself doesn't know when you are going to upload the charm, or whether someone else will upload a revision of the charm before you.)

Snapstore/charmhub do not like the idea of on-the-fly editing the content that was uploaded. They want the bits that you had them to be exactly the bits that you get back. So 'revision' is conceptually not palatable (the only one that can know it is charmhub, and they don't want to populate it).
Similarly `juju download` wouldn't be giving you the exact bits that you uploaded, either.

The best workaround that I know of is to populate the `version` file with something like `git describe --tags --dirty > version`.
Charmcraft *will* pack that into the .charm file, and it will show up in `juju status --format=yaml`.

We can discuss a longer term solution involving charm assertions (equivalent of snap assertions) where a separate file is created that ends up signed by the store to indicate extra properties of the snap. But that is not a trivial fix for anyone involved. (you can't just download a single .charm anymore, you have to carry around the assertions and sideload them as you are doing other things, the store needs to be able to produce them, and juju needs to be able to do something with them.)

`version` is at least available today for all products involved. (other than you have to update your build to not *just* be `charmcraft pack`, as you probably don't want to commit your `version` file because once you do, it is immediately out of date.)