Skip to content

[backport] Fix quarto install tinytex failing on GitHub API rate limit - #15391

Merged
cderv merged 5 commits into
v1.11from
backport/tinytex-rate-limit
Nov 17, 2026
Merged

cderv merged 5 commits into
v1.11from
backport/tinytex-rate-limit

Conversation

@cderv

@cderv cderv commented Nov 17, 2026

Copy link
Copy Markdown
Member

Important

Backport of #15388 to v1.11.

When quarto install tinytex runs behind a shared IP (GitHub Actions runners, Docker build farms, corporate NAT), it can fail with Unable to determine latest release for rstudio/tinytex-releases and 403 - Forbidden.

Quarto looked up the latest TinyTeX release through the GitHub REST API, which allows 60 anonymous requests per hour per IP. Install made two of those calls and quarto update tinytex made three. #15388 resolves the latest tag from the github.com releases redirect instead, probes the bundle download URL with a HEAD request, reuses the release across install and update, and reads GITHUB_TOKEN after GH_TOKEN. The API is still used when a token is set.

The four code commits cherry-apply to v1.11. The only conflict was tools/runtime-boundary-baseline.json, where the v1.11 values are kept. The runtime boundary check passes against upstream/v1.11 with them, since the ported code uses slightly fewer Deno.* calls than that baseline allows.

The changelog entry from #15388 targets changelog-1.12.md, which does not exist on this branch. It is added as a separate commit under # v1.12 backports > ## In this release of changelog-1.11.md.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

`quarto install tinytex` looked up rstudio/tinytex-releases through
api.github.com, whose unauthenticated limit is 60 requests per hour per
IP, and one install made two lookups (the tool summary, then
preparePackage). Behind shared egress (CI runners, Docker build farms,
corporate NAT) the install failed with "Unable to determine latest
release for rstudio/tinytex-releases 403 - Forbidden".

Without a token, the tag now comes from the 302 that
github.com/<repo>/releases/latest returns to releases/tag/<tag>, and the
download URLs are built from the tag with tinyTexPkgName(), the way the
yihui.org install scripts use fixed URLs. Those candidates are not
checked against an asset list any more, so preparePackage moves on to
the next candidate (old naming) when a download is a 404. The API stays
the path when a token is set, and the fallback when the redirect carries
no tag: github.com web endpoints have their own anonymous limits.

Install and update now pass the release info they already looked up to
preparePackage instead of fetching it again.

getLatestRelease also reads GITHUB_TOKEN, the variable GitHub Actions
provides, after GH_TOKEN.
An undefined token falls back to githubToken(), which reads GH_TOKEN,
and the test workflow sets GH_TOKEN, so on CI these tests took the
authenticated API path instead of the unauthenticated one they assert.
preparePackage tried the next candidate when a download failed with a
404, but the install context's download exits the process on any
failure, so the old-name fallback could never run. The unit test hid
this with a download stub that returned the 404 instead.

A HEAD request on each github.com download URL now picks the first
candidate that is not a 404 (github.com answers 302 for an existing
asset and 404 otherwise), and only that one is downloaded. This keeps
the install context and the other tools' download handling unchanged,
at the cost of one extra github.com request per install. A HEAD that
fails outright selects the candidate, so the download reports the real
error.
The main-branch entry lives in changelog-1.12.md, which does not exist on v1.11. Backport entries go under the v1.12 backports section of changelog-1.11.md.
@cderv
cderv merged commit 643c62d into v1.11 Nov 17, 2026
48 checks passed
@cderv
cderv deleted the backport/tinytex-rate-limit branch November 17, 2026 17:59
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