Handle Octokit::Forbidden for oversized contributor lists#301
Merged
Conversation
…d empty return Agent-Logs-Url: https://github.com/jekyll/github-metadata/sessions/998e9980-bf0f-4a9b-b759-5a9dcaaf5631 Co-authored-by: parkr <237985+parkr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Capture error for large contributor list API response
Handle Octokit::Forbidden for oversized contributor lists
May 13, 2026
parkr
approved these changes
May 13, 2026
jekyllbot
added a commit
that referenced
this pull request
May 13, 2026
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 GitHub API returns a
403 Forbiddenwith "The history or contributor list is too large to list contributors for this repository via the API" for certain repos. This was an unhandled exception that crashed the build.Changes
lib/jekyll-github-metadata/client.rb— Addedrescue Octokit::Forbiddeninsave_from_errors, logging a warning that includes the original error message and notes it's a GitHub API limitation, then returns the default value so the build continues.spec/webmock/api_get_contributors_forbidden.json— Fixture for the 403 response body.spec/client_spec.rb— Test verifying the method returnsfalseand the warning contains "This is a limitation of the GitHub API" when a 403 is received.Before this change, any call hitting a forbidden endpoint would raise
Octokit::Forbiddenand propagate as aLiquid Exception. After:Build continues and
site.github.contributorsreturns an empty/falsy value.