Commit 19e6d8a
committed
fix(versioncheck): pick semver-max instead of first stable tag
cmd/versioncheck was treating LatestTags() as ordered newest-first
and taking the first stable entry. Three of the registries don't
honor that:
- Docker Hub sorts by tag_last_pushed, so a late patch on an old
branch ranks above the real latest (bitcoin: v27.2 ahead of v28.0)
- GHCR and OCI v2 tags/list don't define order at all
Net effect: ~12 chains were silently marked "up to date" against a
fake latest (bitcoin, bsc, cardano, cosmos, harmony, klaytn, opbnb,
mantle, ton, goat, gravity-alpha, etc.). Mostly harmless for now
because the real latest is genuinely newer, but it hides real
updates behind false confidence.
Added registry.Newest() — picks semver-max from a slice, skipping
unparseable tags. Caller still strips pre-releases first. Updated
checkVersions to collect all stable tags into a slice and call
Newest(), instead of break-on-first.
Re-running cmd/versioncheck shows the expected fixes:
- bitcoin v28.0 -> v28.0 (was v27.2)
- ton v2026.02-1 -> v2025.03 (was v2024.08)
- gravity-alpha v3.6.8 -> v3.6.8 (was v2.3.3)
- cosmos v27.0.0 -> v25.2.0 (was v19.0.0)
- opbnb v0.5.2 -> v0.4.1 (was v0.2.0)
- goat v0.4.2 -> v0.4.2 (was v0.1.0)
Some chains still report a too-old latest (harmony, bsc 1.3 vs real
1.6.x) — those are pagination issues in the registry clients, the
real latest just isn't in the first 50 tags Docker Hub returns.
That's a separate fix.
Also narrowed .gitignore "versioncheck" -> "/versioncheck" so the
pattern matches only the root-level compiled binary, not the
cmd/versioncheck/ source dir (git refused to add main.go otherwise).
Context: traced bitcoin's "up to date v28.0 vs v27.2" output back
to checkVersions(); read internal/registry/{client,dockerhub,ghcr,
oci}.go to confirm none of them sort by semver; added 6 test cases
for Newest including CalVer (TON-style v2026.02), prefix stripping,
and unparseable-tag skipping. ~45 min total.1 parent d6345d5 commit 19e6d8a
4 files changed
Lines changed: 76 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
39 | 56 | | |
40 | 57 | | |
41 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
44 | 93 | | |
45 | 94 | | |
46 | 95 | | |
| |||
0 commit comments