Fix update check to read latest version from GitHub directly#41
Open
aboullaite wants to merge 2 commits into
Open
Fix update check to read latest version from GitHub directly#41aboullaite wants to merge 2 commits into
aboullaite wants to merge 2 commits into
Conversation
added 2 commits
June 12, 2026 19:41
The CLI's update check was going through the backend API, which reads the latest version from a GCS object that the release pipeline never updates. This caused `save-to-spotify update` to report "Already up to date" even when newer versions exist on GitHub. Switch the primary version source to the GitHub Releases API, with the backend as a fallback. This also removes the auth requirement for update checks.
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
updatecommand was checking the backend API (/api/v1/cli/releases/latest) for the latest version, but the backend reads from a GCS object (gs://sts-image-uploads/cli/latest.txt) that the release pipeline never updates — it was stuck at0.1.0-rc.7.Root cause
The release workflow (
release.yml) creates GitHub releases but never writes the version to GCS or Artifactory. The GCS object was last updated during the pre-release phase and has been stale since stable releases started.What changed
config/config.go: AddedGitHubReleasesURLvar (resolved at init, overridable viaSAVE_TO_SPOTIFY_GITHUB_RELEASES_URL)cmd/update.go:fetchLatestVersion()now tries GitHub first (fetchFromGitHub), falls back to the backend (fetchFromBackend). ExtractedvalidatedVersion()helper to deduplicate version validation.Test plan
go test ./...)TestFetchLatestVersionFallsBackToBackendverifies fallback behaviorTestFetchLatestVersionReturnsAssetURLverifies asset matching from GitHub responsesave-to-spotify update --checkand verify it reports the correct latest version