fix(version): make check train-aware #116
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/YT-57-train-aware-version-check"
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 checkresolved "newer" by listing the registry's package versions and returning the highestv<semver>, ignoringBAKED_TRAINentirely.yt version updateresolves the train first and only compares semver on the release train; on the latest train it fetches the movinglatestbuild directly. The two commands therefore answered different questions for a latest-train binary.The defect that follows: the
latestartifact carries whatever versionCargo.tomlheld at the commit it was built from, so every merge tomainafter a release republisheslatestat an unchanged version number.checkcompared the running version against the highest release, saw them equal, and reported "up to date" while newer builds existed. The latest train's whole purpose is to trackmain, and that was precisely whatcheckwas structurally incapable of reporting. The inverse also appeared during the post-release race window, wherecheckadvertised a release thatupdateon the latest train would not install.checknow resolves the train the wayupdatedoes and asks the question each train can answer. On the release train the behavior is unchanged: highest publishedv<semver>against the running version, which is exactly whatupdate --train releaseinstalls. On the latest train it stops comparing semver and compares build identity instead, fetching the publishedlatestchecksum sidecar (<url>.sha256, already produced by the release flow and consumed byverify_checksum) and comparing it against the hash of the running binary. That needs no new CI artifact and keys on the same bytesupdatewould install. A missing or unparseable sidecar reports that freshness cannot be determined rather than falling back to the semver comparison that is blind to this train.Output now names the train it evaluated, since a bare version number is ambiguous on the latest train, and the latest-train arm quotes the build commit instead of a version number.
resolve_trainand the newresolve_basemove to the version module so both commands share one definition, andcheckgains the same--trainoverrideupdatehas. Theversion check/version updatelong help documents the two trains and that--train releaseis how to move to tagged releases.#YT-57
checktrain-aware