fmartinou / whats-up-docker

What's up Docker ( aka WUD ) gets you notified when a new version of your Docker Container is available.
https://fmartinou.github.io/whats-up-docker
MIT License
945 stars 29 forks source link

Issues after switching to semver tagging #153

Closed alexdelprete closed 1 year ago

alexdelprete commented 1 year ago

Hi,

after reading your documentation, I decided it was time to switch to semver (I only used latestbecause I was lazy). :)

I have 52 containers on 3 docker instances.

WUD is working good on most of them, it took a while to configure everything, but I'm pretty satisfied now.

The only problem I'm having is that many images don't have an appropriate semver versioning on the repo, in particular these ones, as you can see WUD thinks there's an updated version but in reality there's not:

image

Here are the labels I'm using for a couple ot these:

  lidarr:
    image: ghcr.io/linuxserver/lidarr:1.0.2
    container_name: lidarr
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^\d+\.\d+\.\d+$$'
  tautulli:
    image: ghcr.io/linuxserver/tautulli:2.10.2
    container_name: tautulli
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^\d+\.\d+\.\d+$$'

Any suggestions are more than welcome. Thanks for your work on WUD. :)

fmartinou commented 1 year ago

Regarding lidarr, it looks like a person did a mistake and pushed a 8.1.2135 instead of a 0.8.1.2135 😂 image

What a shame... Now lidarr semver versions are wrong... until the 9.x... 😄

In the meantime, I see no other way than to adjust the regex.

Something like

  lidarr:
    image: ghcr.io/linuxserver/lidarr:1.0.2
    container_name: lidarr
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^[0-7]+\.\d+\.\d+$$'
alexdelprete commented 1 year ago

All the *arr apps have messy semver tagging. :)

Thanks for the lidarr tip, what about whisparr? Why does it think that .9 is an upgrade vs .49? :)

  whisparr:
    image: ghcr.io/hotio/whisparr:nightly-0.1.0.49
    container_name: whisparr
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^nightly\-\d+\.\d+\.\d+\.\d+$$'

image

fmartinou commented 1 year ago

Why does it think that .9 is an upgrade vs .49? :)

Because the digits in fourth position are not compliant with the semver specification My guess is that these parts of the version are compared as strings. So the string 9 is greater than the string 49.

The version 0.1.0.49 is not compliant with semver but 0.1.0-49 would be. (please pay attention to the DASH instead of the DOT).

So regarding semver:

You can get around this problem using a wud.tag.transform label.

I see 2 possible solutions:

1. The easiest one is to just drop the last non compliant part

  whisparr:
    image: ghcr.io/hotio/whisparr:nightly-0.1.0.49
    container_name: whisparr
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^nightly\-\d+\.\d+\.\d+\.\d+$$'
      - wud.tag.transform=^nightly-(\d+\.\d+\.\d+).*$$ => $$1

2. The other one is to rewrite the version as a valid semver one (ie nightly-0.1.0.49 must become 0.1.0-49)

  whisparr:
    image: ghcr.io/hotio/whisparr:nightly-0.1.0.49
    container_name: whisparr
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^nightly\-\d+\.\d+\.\d+\.\d+$$'
      - wud.tag.transform=^nightly-(\d+\.\d+\.\d+).(\d+)$$ => $$1-$$2
alexdelprete commented 1 year ago

Thanks, I opted for solution 2 for whisparr.

Now only 5 images left to fix, but I guess it's difficult to fix these...maybe I should contact the maintainers:

image

fmartinou commented 1 year ago

A quick workaround could be filtering on versions where the MAJOR digit contains 2 or three characters maximum...

Like 'wud.tag.include=^\d{1,2}\.\d+\.\d+$$'

It will filter out all tags looking like "calver" (2021.x.y, 2022.x.y...)

alexdelprete commented 1 year ago

I must learn regexp...but I hate it...:)

alexdelprete commented 1 year ago

Everything fixed...thank you so much, I appreciate your help.

I was thinking that maybe for these *arr apps I should switch to latest tag, since the semver of their images are so messy.