canonical/charming-actions

`upload-charm` writes release notes with undefined version

Closed this issue · 1 comments

Bug Description

Running charmcraft 2.0.0, the upload-charm action published this release with undefined version number.

I believe the source of this issue is because the --quiet flag's behaviour has changed:

  • charmcraft 1.7.x: --quiet removed all output except for the final message ("Revision X ..." for success, or "Upload failed with status ..." for failure)
  • charmcraft 2.0.0: --quiet silences all output, both for success and failure. So revision cannot be pulled from the stdout, and an error cannot be inferred from the text either (but can be inferred from $?)

To Reproduce

see this ci run

You can also try yourself by charmcraft upload somecharm --quiet on 1.7.x and 2.0.0

Environment

charmcraft 2.0.0

Relevant log output

see [this ci run](https://github.com/canonical/alertmanager-k8s-operator/actions/runs/2676384442)

Additional context

Fixing this so it properly parses charmcraft 2.0.0 would be excellent, but we should also add checks that would have marked rev=undefined as a failure in the action as well. That way it fails loudly, rather than "works" incorrectly

charmcraft upload xyz --format json now exists, and will be easier to parse