Skip to content

Replace GitHub API version checks with redirect-based lookups to avoid rate limits#3141

Merged
PEZ merged 2 commits intoBetterThanTomorrow:devfrom
marco-carvalho:github-api-rate-limit
Mar 21, 2026
Merged

Replace GitHub API version checks with redirect-based lookups to avoid rate limits#3141
PEZ merged 2 commits intoBetterThanTomorrow:devfrom
marco-carvalho:github-api-rate-limit

Conversation

@marco-carvalho
Copy link
Copy Markdown
Contributor

@marco-carvalho marco-carvalho commented Mar 16, 2026

What has changed?

Replaced GitHub REST API calls (api.github.com) with redirect-based version lookups using the /releases/latest page URL to avoid the 60 requests/hour unauthenticated rate limit.

  • Added a shared getLatestGitHubReleaseTag utility in src/utilities.ts that extracts the version tag from the GitHub releases redirect URL.
  • Replaced getLatestVersion and getLatestNightlyVersion in src/lsp/client/downloader.ts with calls to the shared utility.
  • Replaced the API-based getLatestVersion in src/nrepl/deps-clj.ts with a call to the same shared utility.

Fixes #3142

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Made sure there is an issue registered with a clear problem statement that this PR addresses, (created the issue if it was not present).
    • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • Confirmed that there are no linter warnings or errors (use the eslint extension, run npm run eslint before creating your PR, or run npm run eslint-watch to eslint as you go).

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 16, 2026

Deploy Preview for calva-docs ready!

Name Link
🔨 Latest commit a5edb6f
🔍 Latest deploy log https://app.netlify.com/projects/calva-docs/deploys/69bc3546a01e910008ae869b
😎 Deploy Preview https://deploy-preview-3141--calva-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@marco-carvalho marco-carvalho force-pushed the github-api-rate-limit branch from fae2492 to cea4831 Compare March 16, 2026 03:20
@marco-carvalho marco-carvalho changed the base branch from published to dev March 16, 2026 03:21
@PEZ
Copy link
Copy Markdown
Collaborator

PEZ commented Mar 16, 2026

Thanks! Makes total sense. Right now it doesn't build, though. Not sure you've seen? https://app.circleci.com/pipelines/github/BetterThanTomorrow/calva/9788/workflows/6e54127a-8060-499b-806e-ccd9995ea9d7/jobs/59810

@marco-carvalho marco-carvalho force-pushed the github-api-rate-limit branch from cea4831 to a80acec Compare March 16, 2026 12:18
@marco-carvalho
Copy link
Copy Markdown
Contributor Author

@PEZ sorry, fixed!

@marco-carvalho marco-carvalho force-pushed the github-api-rate-limit branch 2 times, most recently from 8631397 to 8e2a33c Compare March 19, 2026 17:39
@marco-carvalho marco-carvalho force-pushed the github-api-rate-limit branch from 8e2a33c to 968e728 Compare March 19, 2026 17:40
@marco-carvalho
Copy link
Copy Markdown
Contributor Author

@PEZ good morning! if you would be so kind, could you review again, please?
I still don't know why, but sometimes I'm hitting this annoying rate limit 😅

@PEZ PEZ merged commit 79abca2 into BetterThanTomorrow:dev Mar 21, 2026
5 checks passed
@PEZ
Copy link
Copy Markdown
Collaborator

PEZ commented Mar 21, 2026

Thanks!!!

jramosg pushed a commit to jramosg/calva that referenced this pull request Mar 28, 2026
…-api-rate-limit

Replace GitHub API version checks with redirect-based lookups to avoid rate limits

* Fixes BetterThanTomorrow#3142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calva should avoid GitHub API rate limits when checking for tool updates

2 participants