Respect charm channel in air-gapped environment

Bug #2039544 reported by Pedro Guimarães
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
New
Undecided
Unassigned

Bug Description

This is a follow-up from: https://bugs.launchpad.net/juju/+bug/2034206

Although there is a mechanism to set version and revision for a charm in [1, 2], in the charm developer side, this is suboptimal.
It means we would have to keep a single branch containing the revision file that would be the source of truth and channels would have to be cherry-pick commits from that main branch.

Ideally, we want to have one branch per channel thou. Hence, we need not only to set revision numbers but also channel information.

We need an equivalent mechanism, say a "channel" file, where we can write the channel track/risk/branch and that to be taken into consideration if we are deploying from a local charm.

References
[1] https://github.com/juju/charm/blob/master/charmdir.go#L258C1-L260C3
[2] https://github.com/juju/juju/blob/3.3/cmd/juju/application/utils/origin.go#L44-L64

Revision history for this message
Pedro Guimarães (pguimaraes) wrote :
Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

From the charmhub side, there is:
* https://github.com/canonical/charmhub.io/issues/727

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

If you are going to have one branch per channel, why not encode that information into your version file?

You can do:
(git describe --dirty --tags | tr '\n' ' ' ; git branch --show-current) > version

Which gives something like:

v3.1.6-81-g3782cb5194 3.1

And that will give you the branch that this was developed on, and the exact git sha where it was developed.

We already provide a way for you to have the charm author defined information available in 'version' to be displayed in status, I'm not sure we need another way to do that.

I disagree with the general philosophy that "deploying from a downloaded snap should be equivalent to deploying from the store", because we can't do updates or tracking, etc.

I understand that ultimately you want to be able to understand that at this site would be equivalent if you could have deployed from the store.
However, I really don't think we should be encoding that into the charm binary itself. Because how you get it from the store can very easily change with time, while the charm binary itself cannot.

If you published revision 24 to latest/edge you could then promote it to latest/stable, and/or expose it as 3.1/stable, all of which would be valid sources for that revision 24, but would have different implications for 'juju refresh'.

If the goal is to be able to reverse engineer "what was deployed there", we have version for that, and if your tagging structure is such that it isn't enough for you to actually define what is there and you need branch, then include that in your version.

It is incorrect to say that I got 'revision 24 but I got it from latest/edge' meaning something different than getting 'revision 24 from 3.1/stable'

I would be a bit more ok if you wanted to just record that in current juju state (deploy ./foobar.charm but pretend it came from the store at revision X and channel Y/R)

But if you want the actual binary that you deploy to be the binary that you get from the store, then it shouldn't be modified.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.