Files
hassio-addons/addons_updater/rootfs/usr/bin
Alexandre a989e7fbdc feat(addons_updater): write Home Assistant compliant addon versions (#2925)
* feat(addons_updater): write Home Assistant compliant addon versions

The updater copied the raw upstream tag into config.yaml. Home Assistant
orders addon versions with awesomeversion and hides the update when it can
compare both versions and the new one is not strictly newer, so tags such
as 1.2.3-2, 1.2.3+4 or 1.2.3-2026-08-01 silently stopped the update from
being offered, and tags such as version-bf9e0b4f or ubuntu-2026-06-01
cannot be ordered at all.

The addon version is now derived from the upstream tag by ha_version.py,
using the same library Home Assistant uses: a sortable and newer tag is
kept as it is, 1.2.3-4 and 1.2.3+4 become 1.2.3.4, otherwise the release
number inside the tag, an incremented addon number or the date is used.
updater.json keeps the raw upstream tag, so the same upstream release is
never published twice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(addons_updater): address review comments

- calendar versions carrying a counter now advance to the current date
  instead of only incrementing the counter
- --selftest runs against a fixed date, so it keeps passing after today
- config.json is written from a validated jq result, as updater.json is
- README states the raw tag is added to the changelog only when it
  differs from the addon version
- docstring, comment and changelog formatting

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(addons_updater): turn pre-release markers into a version section

"5.0.0b5" is published as "5.0.0.5" so the beta number keeps ordering
the addon instead of relying on how awesomeversion reads the marker.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(addons_updater): keep every number of an unorderable tag

"v26.2-ls256" is published as "v26.2.256", "nightly-2.6.1.5509-ls8" as
"2.6.1.5509.8" and "4.16-r0-ls94" as "4.16.0.94", so the build number
keeps ordering the addon instead of being dropped. Words holding no
number, architectures and commit hashes are left out, and a section
ending on a year is counted up rather than incremented.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style(addons_updater): keep the helper docstrings on one line

Codacy runs pydocstyle with D213, which the multi-line summary added
with the numbers rule trips.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(addons_updater): leave out more arch words and unreal dates

"i686" and friends were read as the number 686, and "2026.02.31" was
taken for a calendar version. Both now fall back to the plain number
rules.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 18:51:14 +02:00
..