Skip to content

feat(updater): find the latest release without the rate-limited GitHub API - #604

Merged
linroid merged 3 commits into
mainfrom
feat/release-checksums-file
Oct 19, 2026
Merged

linroid merged 3 commits into
mainfrom
feat/release-checksums-file

Conversation

@linroid

@linroid linroid commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

The app and ketch update asked 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.

  • Release workflow: after action-gh-release uploads the files, a new step writes a SHA256SUMS file (sha256sum format, one line per uploaded file) and uploads it last. Every file it names is already there by then.
  • GitHubReleases.latest():
    • Reads the tag from the github.com/<repo>/releases/latest redirect.
    • Downloads releases/download/<tag>/SHA256SUMS and builds the asset list (names, download URLs, SHA-256 digests) from it. Neither request counts against the API's limit.
    • Falls back to the API, as before, when the website fails, names no tag, or the release has no usable SHA256SUMS. That covers every release published before this one, and a release still uploading.
  • What a release read from the website lacks: notes, publish time and file sizes (ReleaseAsset.size is 0). Nothing that calls latest() reads the notes. Sizes only fill the progress bar until the download reports its own total. Release notes, release history and ketch update --version still use the API.
  • Docs: updated docs/updates.md and AGENTS.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, and parseSha256Sums (binary-mode *, CRLF, junk and path lines). :cli and :app:desktop compile.
  • Against the real github.com, KtorHttpEngine().request("HEAD", ".../releases/latest") answered 200 with the URL .../releases/tag/v0.10.0 (throwaway test, not committed).
  • Not run: the workflow step. It will run on the next tag.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T05:55:45.934031Z 566ef36 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 2 191 files  ±0   2 219 suites  ±0   56m 18s ⏱️ +24s
15 235 tests +4  14 967 ✅ +4  268 💤 ±0  0 ❌ ±0 
18 586 runs  +4  18 318 ✅ +4  268 💤 ±0  0 ❌ ±0 

Results for commit d1940f0. ± Comparison against base commit 566ee07.

@linroid
linroid merged commit b25a45f into main Oct 19, 2026
14 checks passed
@linroid
linroid deleted the feat/release-checksums-file branch October 19, 2026 07:07
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.

1 participant