Repository navigation
feat(updater): find the latest release without the rate-limited GitHub API - #604
Merged
Merged
Conversation
…b API Each release now uploads a SHA256SUMS file after its other files. GitHubReleases.latest reads the latest tag from the github.com releases/latest redirect and the files and digests from that SHA256SUMS, neither of which counts against the API's 60 unauthenticated requests an hour. Releases without the file, and failures of the website, fall back to the API as before; notes, history and tagged releases still come from the API.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
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
The app and
ketch updateasked the GitHub API for the latest release. The API allows 60 unauthenticated requests an hour per IP, so on a shared address (offices, VPNs, CI) update checks could fail with a 403. This applies the approach from #603 (install.sh) to the updater.action-gh-releaseuploads the files, a new step writes aSHA256SUMSfile (sha256sumformat, one line per uploaded file) and uploads it last. Every file it names is already there by then.GitHubReleases.latest():github.com/<repo>/releases/latestredirect.releases/download/<tag>/SHA256SUMSand builds the asset list (names, download URLs, SHA-256 digests) from it. Neither request counts against the API's limit.SHA256SUMS. That covers every release published before this one, and a release still uploading.ReleaseAsset.sizeis 0). Nothing that callslatest()reads the notes. Sizes only fill the progress bar until the download reports its own total. Release notes, release history andketch update --versionstill use the API.docs/updates.mdandAGENTS.md.Rollout
The website path only takes effect once a release ships
SHA256SUMS. Until the next release, every check falls back to the API, the same as today.Testing
./gradlew :updater:test: new tests cover reading from the website and SHA256SUMS, the API fallback when the file is missing or the redirect names no tag, andparseSha256Sums(binary-mode*, CRLF, junk and path lines).:cliand:app:desktopcompile.KtorHttpEngine().request("HEAD", ".../releases/latest")answered 200 with the URL.../releases/tag/v0.10.0(throwaway test, not committed).