Skip to content

fix: download the preview cask from the release URL, not the rate-limited asset API - #11

Merged
Brendan-Lim merged 1 commit into
mainfrom
fix/cask-browser-download-url
Nov 21, 2026
Merged

Brendan-Lim merged 1 commit into
mainfrom
fix/cask-browser-download-url

Conversation

@Brendan-Lim

Copy link
Copy Markdown
Member

Summary

The preview cask downloaded through the REST asset API (api.github.com/…/releases/assets/ID). Anonymous API calls are limited to 60 an hour per IP, so installs fail with HTTP 403 on shared IPs: it happened twice on GitHub runners this week, and would hit people on campus, office or VPN networks. Switch to the release's browser URL, which has no such limit, with the same checksum.

 cask "contextlens-preview" do
-  version "__VERSION__,__ASSET_ID__"
+  version "__VERSION__"
   sha256 "__SHA256__"
-  url "https://api.github.com/repos/bstack-tools/ContextLens/releases/assets/#{version.csv.second}",
-      header: "Accept: application/octet-stream"
+  url "https://github.com/bstack-tools/ContextLens/releases/download/v#{version}/ContextLens-#{version}-arm64.zip"
-render_cask(version, checksum, asset_id)
+render_cask(version, checksum)        # published_assets() still checks the exact browser URL
  • distribution/homebrew/scripts/validate.py: the preview template/cask must use the browser URL and no asset ID.
  • test_preview_release.py: covers the new URL, no api.github.com, no leftover placeholders, and rejects bad versions.
  • docs/preview-releases.md: explains the change. The API curl line stays as a manual fallback.

Homebrew's online audit rejects casks whose URL names a GitHub prerelease (SharedAudits.github_release). The old API URL only avoided that check by accident. The tap PR adds contextlens-preview to its audit_exceptions/github_prerelease_allowlist.json, the mechanism homebrew-cask uses for its own beta casks.

The unnotarized stable template (contextlens-unnotarized.rb.in) still uses the asset API. It isn't published yet and targets non-prereleases, so it is left for a separate change.

Evidence

  • python3 -m unittest discover -s scripts/tests: 82 OK (2 skipped). validate.py, link check and publication audit: 0 findings.
  • Tap candidate rendered from this template: run 44922743656. Validate, style, anonymous install/uninstall, online audit and fetch all pass.

Merge Danger

Door: two-way

Blast Radius: release tooling and docs. Takes effect for users only through the tap PR. Merge both together.

@Brendan-Lim
Brendan-Lim merged commit e4bc812 into main Nov 21, 2026
2 checks passed
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