charm-tools icon indicating copy to clipboard operation
charm-tools copied to clipboard

`charm proof` should check that referenced terms are released

Open cmars opened this issue 9 years ago • 1 comments

A charm that references unreleased or non-existent terms in its metadata.yaml cannot be released.

Therefore I recommend that the charm proof tool check this, for charms that use terms.

The API call is simple:

https://api.jujucharms.com/terms/v1/terms/{owner}/{term-name} yields a list of all revisions for the term {term-name} owned by {owner}. Add ?revision={rev-no} for a specific revision.

https://api.jujucharms.com/terms/v1/terms/{term-name} does the same for curated term IDs that aren't managed by an owner.

An example response is here: https://api.jujucharms.com/terms/v1/terms/canonical

You'll want to check for {"published": true} on the resulting object matching the charm's metadata. If none exists, then the charm cannot be deployed and charm proof should at least warn.

cmars avatar Oct 13 '16 17:10 cmars

There's also a Python API for terms in the theblues package to make it even easier.

johnsca avatar Oct 15 '16 19:10 johnsca