Repository navigation
Pin git feature version to avoid GitHub API rate limits - #145
Closed
phil-janeapp wants to merge 1 commit into
Closed
phil-janeapp wants to merge 1 commit into
phil-janeapp wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The image builds fail intermittently with
API rate limit exceeded. In run 45017003256 (tagruby-2.3.7, #142), 11 of the build jobs failed with:Earlier runs of this workflow show the same failure on their first attempt and pass on a re-run.
Cause
The
gitfeature is set to"version": "latest". To resolvelatest, the feature'sinstall.shmakes an unauthenticated request tohttps://api.github.com/repos/git/git/tags. The limit for unauthenticated requests is 60 per hour for each IP, and GitHub-hosted runners share their IPs. Often the limit is already used up when the job starts.Fix
Pin the feature to a full
x.y.zversion. The feature only calls the API when the version does not have three parts (src/git/install.sh, "Partial version matching"). It then downloads the source tarball fromgithub.com/git/git/archive/..., which is not a REST API request.2.56.1is the current latest version, so the image does not change.Testing
I built the image with
api.github.comblocked during the build (--add-host=api.github.com:127.0.0.1), which simulates a runner with no API limit left. I did this onubuntu-24.04runners in my fork (linux/amd64, Ruby 3.3.13) and locally (arm64, Ruby 4.0.10 and 3.3.0):git --versionreturns2.56.1. The Ruby feature (mise, precompiled rubies) also needs no API calls."latest", the build fails at the git feature, as in CI.devcontainers/ci@v0.3with the same inputs asbuild-and-publish-image(push: never).Notes
inputs.image_tag, so this change affects only tags created after merge. A new tag (for exampleruby-2.3.8) is necessary. Until then, re-running the failed jobs works."version": "os-provided". It removes all GitHub requests and the git compile step (about 160 s per job), but the image then gets Debian's git 2.47.🤖 Description generated with Claude Code, approved by a human