fix(version): compare published registry versions, not Last-Modified #93
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/YT-37-version-check-compare-published-versions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
yt version checkHEADed thelatest/yt-linux-x86_64artifact and compared itsLast-Modifiedheader against the baked build date. The Forgejo Generic Packageregistry serves no parseable
Last-Modified, so the check always fell into the"Could not determine remote build date" arm and was non-functional against the
real registry.
Replace that mechanism with a version-list comparison matching
fj: GET theGeneric Package version list (
/api/v1/packages/<owner>?type=generic&q=<name>,derived from the baked download base), parse each entry, discard non-semver
entries such as the moving
latestpointer, and take the highestv<semver>.yt version checkcompares that maximum againstCARGO_PKG_VERSIONand printsNew version available(pointing atyt version update) or an up-to-date line.yt version update's pre-download short-circuit uses the same comparison so itstops always-downloading;
--forcestill bypasses it. TheLast-Modifiedhelper (
fetch_remote_freshness/compare_build_dates/RemoteFreshness)and the now-dead
BAKED_BUILD_DATEconst are removed, and the freshness testsare rewritten to mock the version-list endpoint. Adds the
semvercrate forcorrect precedence (0.10.0 > 0.9.0).
#YT-37