Promulgate a charm for charmers team

Promulgation pattern for the ~charmers team and folks helping to managing the default flat namespace of Juju charms.

Setup (first time only)

snap install bhttp

Copy this helper into your .bash_aliases file.

unset -f promulgate
function promulgate() {
    charm_id=${1#cs:}
    promulgated=${2:-true}
    bhttp put -j https://api.jujucharms.com/charmstore/v5/$charm_id/promulgate Promulgated:=$promulgated
}

Promulgating a Charm

First, make sure there isn’t already something promulgated into the namespace with:

charm show cs:<charm>

If there is, you’ll need to unpromulgate it first (assuming it’s ok to transfer maintainership).

Then, confirm that the charm to be promulgated is readable by everyone and promoted to stable with:

charm show cs:~<namespace>/<charm>

If everything looks good

promulgate cs:~<namespace>/<charm>

The charm author isn’t granted update permissions by default, so you have to then do:

charm grant cs:<charm> --acl write <user>

Unpromulgation

This must be careful as this breaks existing bundles/urls for folks using this charm in any fashion.

 promulgate cs:<charm> false

I went ahead and codified (currently up for review) this into two new charm commands:

  • charm promulgate cs:<charm-id>
  • charm unpromulgate cs:<charm-id>

This should allow us to use standard commands, and ensure that the proper checks are done so that we don’t promulgate something into a broken state. Please review, and when available, we can update this doc to use the new commands.