Skip to content

Handle Octokit::Forbidden for oversized contributor lists#301

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/capture-contributors-api-error
Open

Handle Octokit::Forbidden for oversized contributor lists#301
Copilot wants to merge 2 commits into
mainfrom
copilot/capture-contributors-api-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

The GitHub API returns a 403 Forbidden with "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 — Added rescue Octokit::Forbidden in save_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 returns false and 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::Forbidden and propagate as a Liquid Exception. After:

GitHub Metadata: GET .../contributors?per_page=100: 403 - The history or contributor list
is too large... This is a limitation of the GitHub API.

Build continues and site.github.contributors returns an empty/falsy value.

Copilot AI changed the title [WIP] Capture error for large contributor list API response Handle Octokit::Forbidden for oversized contributor lists May 13, 2026
Copilot finished work on behalf of parkr May 13, 2026 00:04
Copilot AI requested a review from parkr May 13, 2026 00:04
@parkr parkr marked this pull request as ready for review May 13, 2026 01:01
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.

"The history or contributor list is too large to list contributors for this repository via the API"

2 participants