Skip to content

CI: download leantar from the public URL when the API rate-limits the token - #4765

Merged
alex merged 2 commits into
mainfrom
claude/ci-rate-limit-all-green
Nov 8, 2026
Merged

alex merged 2 commits into
mainfrom
claude/ci-rate-limit-all-green

Conversation

@alex

@alex alex commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

CI only.

When the repository token's rate limit is spent, all-green's REST listing of the run's artifacts returns nothing. all-green then concludes that no shard assembled the build and assembles it itself, which is correct but slow. It failed only because the same rate limit refused its leantar download: ci/github_release.py got an HTTP 403 from the release API (#4683: job 128879421741 of run 42528561424; #4750: run 42528625150).

The fix is in ci/github_release.py: when the API refuses the token (403 or 429), the download goes to the release's public URL, which the API's rate limit doesn't count. ci/leantar_release.py still checks its pinned SHA-256, so what CI trusts doesn't change. A unit test covers the fallback.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TKUFHGBeNadVff4mCVhkSH

all-green and lean-cache found the lean-assembled-<shard> markers by
listing the run's artifacts through the REST API and grepping the list, so
a refused listing ("API rate limit exceeded for installation") read as "no
marker": all-green then assembled the build itself, and failed when the
same limit refused leantar's download.

* .github/actions/lean-assembled: finds the markers by downloading them
  through the artifact service (download-artifact, which v8 lets match
  nothing and which retries, then fails, on an error), not the REST API.
  all-green and lean-cache use it, with a sparse checkout of the actions.
* ci/github_release.py: a download the API refuses (403, 429) comes from
  the release's public URL, outside the API's rate limit. leantar's pinned
  SHA-256 is checked either way.
* lean-shard: the best-effort listing of uploaded shards is tried again
  before it leaves the assembly to another job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHGBeNadVff4mCVhkSH
@alex

alex commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

This patch is way too big, it should be a trivial fix not a giant refactor

Only the download needs fixing: when no shard is found to have assembled
the build, all-green assembles it itself, which failed only because the
API refused its leantar download. Revert the workflow changes and the new
action; keep the public-URL fallback in ci/github_release.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHGBeNadVff4mCVhkSH
@alex alex changed the title CI: don't read a rate-limited API as "no shard assembled the build" CI: download leantar from the public URL when the API rate-limits the token Nov 8, 2026

alex commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Cut down to the one fix needed. If the artifact listing fails, all-green builds the Lean code itself, which is correct and was only failing because the same rate limit refused its leantar download. ci/github_release.py now falls back to the release's public URL on a 403 or 429. I've reverted the workflow changes and the new action, so the diff is now 2 files, +27/−6.


Generated by Claude Code

@alex
alex enabled auto-merge November 8, 2026 22:25
@alex
alex added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 7e2c0ba Nov 8, 2026
23 checks passed
@alex
alex deleted the claude/ci-rate-limit-all-green branch November 8, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants