canonical / charming-actions

A collection of Github Actions for interaction with Charmhub, and validating Charmed Operator code
9 stars 22 forks source link

fix(upload-charm): Use resource revision from upload-resource command #147

Closed orfeas-k closed 3 months ago

orfeas-k commented 3 months ago

Use resource revision number returned by upload-resource command when uploading a charm with resources. This replaces the previous behaviour when the action was listing resources and was using the latest available.

The issue below documents why we need this change and why this change works. In short, the root cause is that Charmhub changed its behavior at some point and running charmcraft upload-resource does not create a new resource revision, breaking essentially the action which previously ran charmcraft upload-resource followed by charmcraft resource-revisions and was attaching the latest available to the charm.

Here's an example run using the action from the PR's branch.

Closes #139 Ref canonical/bundle-kubeflow#962

Note that this PR does not touch the action's behavior where upload-image is set to False, given that this is a different use-case and its behavior wasn't altered by the aforementioned Charmhub change (it was just using the latest resource revision number available without uploading anything). We contacted however the people using it (operator-workflows repo ) to give them a heads up of the change.