fix: resolve install.sh latest version without the GitHub API (#325)#336
Merged
Merged
Conversation
The standalone installer resolved the latest release via the GitHub API, which rate-limits unauthenticated requests to 60/hr per IP and returns 403 on shared or cloud hosts (devboxes, CI) — leaving "could not resolve latest version". It now reads the version from the releases/latest web redirect (no rate limit), falling back to the API, and normalizes CODEGRAPH_VERSION so a bare "0.9.4" works as well as "v0.9.4". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closed
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.
Problem
On shared/cloud hosts (the reporter is on
root@devbox),install.shfails withcurl: (22) 403→could not resolve latest version(#325). It resolved the latest release throughapi.github.com, and GitHub's unauthenticated API is rate-limited to 60 requests/hour per IP — easily exhausted where many users share an address — returning 403.(The
no prebuilt bundle for linux-x64in the same screenshot is #303, already fixed in #335; this PR covers theinstall.shhalf.)Fix
releases/latestweb redirect (github.com/<repo>/releases/latest→Location: .../tag/vX.Y.Z) instead of the API — no token, no rate limit. Falls back to the API if the redirect can't be read.CODEGRAPH_VERSIONso a bare0.9.4works as well asv0.9.4(the release-tag form). The reporter'sCODEGRAPH_VERSION=0.9.3wouldn't have matched thev0.9.3tag even if it had been passed through.Validation
End-to-end on darwin-arm64 into temp dirs (
CODEGRAPH_INSTALL_DIR/CODEGRAPH_BIN_DIR):CODEGRAPH_VERSION→ redirect resolvesv0.9.3→ installs →codegraph --version=0.9.3.CODEGRAPH_VERSION=0.9.3(bare) → normalized tov0.9.3→ installs → works.sh -n install.shpasses.Closes #325
🤖 Generated with Claude Code