026 — tp self update sees a release as soon as it is published (#161)
Status: in progress
Why
tp self update and the Update available hint resolve the latest
version from proxy.golang.org's @latest endpoint, which the proxy
caches for up to ~30 minutes. The version list (@v/list) is refreshed
when any exact version is fetched, which the release's install
verification does at tag time, so minutes after v0.41.0 was tagged the
list named it while @latest still said v0.40.4: self update
reported "Already up to date" and the hint stayed silent. Had it
installed, go install ...@latest would have resolved through the same
stale cache.
What changes
- The latest version is the highest non-pre-release semver in
@v/list, not@latest. The hint andself updateshare it. self updateinstalls that exact version (go install ...@vX.Y.Z), so the install cannot resolve@latestthrough the stale cache.- When the list cannot be read or names no release,
self updatefalls back togo install ...@latestas before.
Acceptance
@v/list |
current | hint | self update |
|---|---|---|---|
v0.40.4 v0.41.0 (any order) |
v0.40.4 | Update available: v0.40.4 -> v0.41.0 |
installs @v0.41.0 |
v0.40.4 v0.41.0 v0.42.0-rc.1 |
v0.41.0 | silent | "Already up to date." |
v0.41.0 |
v0.41.0 | silent | "Already up to date." |
| unreadable (network, non-200) | any | silent | "Could not check latest version", installs @latest |
| only pre-releases, or empty | any | silent | as unreadable |
Out of scope
- Reading the forge releases API instead of the proxy.
- Honouring
retractdirectives in the version list. - The forge's
created_at/published_aton releases (noted in #161, separate).
Decisions
none
Done when
- tests express the acceptance table and pass
- spec updated (README
tp self) - ADR written if a fork was resolved (none needed)
- roadmap ticked and stamped; changelog entry
- issue closed with a link to the release