Skip to content

Handle Octokit::Forbidden for oversized contributor lists - #301

Merged
jekyllbot merged 2 commits into
mainfrom
copilot/capture-contributors-api-error
May 13, 2026
Merged

Handle Octokit::Forbidden for oversized contributor lists#301
jekyllbot merged 2 commits into
mainfrom
copilot/capture-contributors-api-error

Conversation

CopilotAI commented May 12, 2026

Copy link
Copy Markdown
Contributor

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.

CopilotAI changed the title [WIP] Capture error for large contributor list API responseHandle Octokit::Forbidden for oversized contributor listsMay 13, 2026
CopilotAI requested a review from parkrMay 13, 2026 00:04
@parkr
parkr marked this pull request as ready for review May 13, 2026 01:01

@mattr-mattr- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jekyllbot: merge +fix

@jekyllbot
jekyllbot merged commit bdb421d into mainMay 13, 2026
8 checks passed
@jekyllbot
jekyllbot deleted the copilot/capture-contributors-api-error branch May 13, 2026 15:58
jekyllbot added a commit that referenced this pull request May 13, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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"

4 participants

@mattr-@parkr@jekyllbot