canonical / charmcraft

Collaborate, build and publish charmed operators for Kubernetes, Linux and Windows.
Apache License 2.0
66 stars 72 forks source link

Indicate closed tracks differently to empty tracks #1108

Open taurus-forever opened 1 year ago

taurus-forever commented 1 year ago

What needs to get done

Hi,

The charmcraft status <mycharm> is confusing when the track is closed as the same sign - used for not-yet-uploaded revisions and closed tracks Example (all tracks latest/* are closed):

> charmcraft status mysql-k8s
Track    Base                  Channel    Version    Revision    Resources                                                                                                                                                                            
latest   -                     stable     -          -           -                                                                                                                                                                                    
                               candidate  -          -           -                                                                                                                                                                                    
                               beta       -          -           -                                                                                                                                                                                    
                               edge       -          -           -                                                                                                                                                                                    
8.0      ubuntu 22.04 (amd64)  stable     75         75          mysql-image (r74)                                                                                                                                                                    
                               candidate  75         75          mysql-image (r74)                                                                                                                                                                    
                               beta       75         75          mysql-image (r74)                                                                                                                                                                    
                               edge       81         81          mysql-image (r80) 

Also the last revision in closed track is still installable:

> juju deploy mysql-k8s --channel latest/edge
Located charm "mysql-k8s" in charm-hub, revision 60
Deploying "mysql-k8s" from charm-hub charm "mysql-k8s", revision 60 in channel latest/edge on jammy

It is a proposal to improve the output to: 1) indicate the track is closed instead of showing sing - (9.0 here is an example of not-yet-published channels):

> charmcraft status mysql-k8s
Track    Base                  Channel    Version    Revision    Resources                                                                                                                                                                            
latest   X                     stable     X          X           X                                                                                                                                                                                    
                               candidate  X          X           X                                                                                                                                                                                    
                               beta       X          X           X                                                                                                                                                                                    
                               edge       X          X           X                                                                                                                                                                                    
8.0      ubuntu 22.04 (amd64)  stable     75         75          mysql-image (r74)                                                                                                                                                                    
                               candidate  75         75          mysql-image (r74)                                                                                                                                                                    
                               beta       75         75          mysql-image (r74)                                                                                                                                                                    
                               edge       81         81          mysql-image (r80) 
9.0      ubuntu 24.04 (amd64)  stable     -          -           -                                                                                                                                                                    
                               candidate  -          -           -
                               beta       -          -           -                                                                                                                                                                   
                               edge       95         95          mysql-image (r94) 

2) still show the revisions for the closed tracks (the best case scenario):

> charmcraft status --verbose mysql
Track    Base                  Channel    Version    Revision    Resources           State                                                                                                                                                                              
latest   ubuntu 22.04 (amd64)  stable     -          -           -                   closed                                                                                                                           
                               candidate  -          -           -                   closed                                                                                                                                                                                                                                                                                                       
                               beta       -          -           -                   closed                                                                                                                                                              
                               edge       60         60          mysql-image (r59)   closed
8.0      ubuntu 22.04 (amd64)  stable     75         75          mysql-image (r74)   open                                                                                                                                                                 
                               candidate  75         75          mysql-image (r74)   open                                                                                                                                                                    
                               beta       75         75          mysql-image (r74)   open                                                                                                                                                                    
                               edge       81         81          mysql-image (r80)   open 
9.0      ubuntu 24.04 (amd64)  stable     -          -           -                   empty                                                                                                                                                      
                               candidate  94         94          mysql-image (r93)   open 
                               beta       ↑          ↑           ↑                   open                                                                                                                                                                    
                               edge       95         95          mysql-image (r94)   open

Thank you!

Why it needs to get done

At the moment it is hard to understand the real state of the old charm (from user experience point of view). Users reports: we have installed the latest revision of your charm (revision 60) and charm author have difficulties to trace where it came from (the closed track latest/edge).

sergiusens commented 1 year ago
juju deploy mysql-k8s --channel latest/edge
Located charm "mysql-k8s" in charm-hub, revision 60
Deploying "mysql-k8s" from charm-hub charm "mysql-k8s", revision 60 in channel latest/edge on jammy

This looks like a bug itself on juju or charmhub; you should not be able to install charms from closed channels; which seems to be the source of confusion

taurus-forever commented 1 year ago

For the history, reported to Juju here: https://bugs.launchpad.net/juju/+bug/2020753