fix(changelogs): handle multiple builds on the same day correctly (#2879)

In the last release [1] I noticed that instead of comparing XX15.2 and
XX15.1 with each other, the tag from last week got resolved because
only the highest index point of that day was kept. So we compared XX15.2 with XX09.1, that resulted in essentially a lot of duplicate information in that release, instead of just a small addition.

The expected output of the test seems like a typo to me.

[1] https://github.com/ublue-os/aurora/releases/tag/stable-20260915.2
This commit is contained in:
renner 2026-09-16 10:27:19 +02:00 committed by GitHub
parent 350361669b
commit 7993ff0a05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,7 +164,7 @@ def get_tags(target: str, manifests: dict[str, Any]):
When multiple builds on the same day, highest index wins: When multiple builds on the same day, highest index wins:
>>> get_tags("stable", imgs(["stable-20260602.1", "stable-20260609.1", "stable-20260609.2"])) >>> get_tags("stable", imgs(["stable-20260602.1", "stable-20260609.1", "stable-20260609.2"]))
('stable-20260602.1', 'stable-20260609.2') ('stable-20260609.1', 'stable-20260609.2')
Most recent tags as of today: Most recent tags as of today:
>>> get_tags("stable", imgs(["stable-20260526", "stable-20260602", "stable-20260602.1", "stable-20260609", "stable-20260609.1"])) >>> get_tags("stable", imgs(["stable-20260526", "stable-20260602", "stable-20260602.1", "stable-20260609", "stable-20260609.1"]))
@ -191,13 +191,12 @@ def get_tags(target: str, manifests: dict[str, Any]):
if tag not in manifest["RepoTags"]: if tag not in manifest["RepoTags"]:
all_tags.remove(tag) all_tags.remove(tag)
# Group by date, keep the highest-indexed tag per date
by_date = defaultdict(list) by_date = defaultdict(list)
for tag in all_tags: for tag in all_tags:
date, idx = parse_tag(tag) date, idx = parse_tag(tag)
by_date[date].append((idx, tag)) by_date[date].append((idx, tag))
flattened = [max(entries)[1] for entries in by_date.values()] flattened = [tag for entries in by_date.values() for idx, tag in entries if idx > 0]
tags = sorted(flattened, key=parse_tag) tags = sorted(flattened, key=parse_tag)
if len(tags) < 2: if len(tags) < 2: