canonical / charming-actions

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

release-libraries does not work on major version bump #103

Closed dstathis closed 1 year ago

dstathis commented 1 year ago

Bug Description

When the major version increases and minor decreases, the library skips releasing the update.

See promethus-k8s-operator CI log output below. prometheus_remote_write 1.1 should have been published.

To Reproduce

Bump major version. Set minor to 0.

Environment

Github

Relevant log output

Run canonical/charming-actions/release-libraries@main
/usr/bin/sudo snap install charmcraft --classic --channel latest/stable
charmcraft 2.4.1 from Canonical** installed
/snap/bin/charmcraft list-lib prometheus-k8s --format=json
[
    {
        "charm_name": "prometheus-k8s",
        "library_name": "prometheus_remote_write",
        "library_id": "f783823fa75f4b7880eb70f2077ec259",
        "api": 0,
        "patch": 15,
        "content_hash": "477f3dc99094dac025835a3691df3462ceeb360ee0ade59149bbcabcf08b5c88"
    },
    {
        "charm_name": "prometheus-k8s",
        "library_name": "prometheus_scrape",
        "library_id": "bc84295fef5f4049878f07b131968ee2",
        "api": 0,
        "patch": 39,
        "content_hash": "dd816a001c52ca853537e8a772f4548a090e7d441b126b71bbedc58e0d226c76"
    }
]
found lib file: ./lib/charms/prometheus_k8s/v0/prometheus_scrape.py. Parsing...
found lib file: ./lib/charms/prometheus_k8s/v1/prometheus_remote_write.py. Parsing...
checking status for prometheus_scrape
remote lib: {"libName":"prometheus_scrape","version":0,"revision":39}
prometheus_scrape will be updated from 0.39 to 0.40
checking status for prometheus_remote_write
remote lib: {"libName":"prometheus_remote_write","version":0,"revision":15}
prometheus_remote_write has a lower version or revision than prometheus_remote_write
Errors found during lib comparison.
Publishing changes:
[{"libName":"prometheus_scrape","old":{"major":0,"minor":39},"new":{"minor":40,"major":0}}]
publishing prometheus_scrape
Successfully published libraries
/snap/bin/charmcraft publish-lib charms.prometheus_k8s.v0.prometheus_scrape
Library charms.prometheus_k8s.v0.prometheus_scrape sent to the store with version 0.40

Additional context

No response

jnsgruk commented 1 year ago

This is a duplicate of #97 - I'll close this for now.