fix(otto): pin auto-update download to cached version - #2135
Open
jlaneve wants to merge 1 commit into
Open
Conversation
autoUpdate logged "Updating Otto X → Y" using the cached LatestKnown value but downloaded from /latest/ on the CDN. When a release shipped between cache refreshes the two diverged, so users saw lines like "Updating Otto 0.1.7 → 0.1.8... Otto 0.1.10 installed". Thread the cached version through downloadAndInstall and downloadURL so the download path matches the version the log promised. EnsureBinary and Update keep using "latest" via a new sentinel const. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coverage Report for CI Build 25Coverage increased (+0.003%) to 39.769%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Contributor
|
This PR is stale because it has been open for 60 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
User feedback:
astro ottoprintedautoUpdateloggedstate.LatestKnownfrom the cached.update-checkfile, butdownloadAndInstallalways fetched the CDN's/latest/alias. When a release shipped between cache refreshes, the two paths diverged.Changes
downloadURL(version)anddownloadAndInstall(version)now take a version string. The CDN already hosts versioned paths (/vX.Y.Z/...), soautoUpdatepassesstate.LatestKnownand the download URL matches the log line.EnsureBinaryandUpdate()keep using"latest"via a new sentinel const.!strings.HasPrefix(v, "v")) so callers can pass either form.Test plan
go build ./pkg/otto/...go vet ./pkg/otto/...go test ./pkg/otto/...TestAutoUpdate_PinsDownloadToCachedVersionfails on the old downloader signatureTestDownloadURL_PinnedVersion+_AlreadyPrefixedcover both v-prefix forms