Skip to content

[BUG] Paginate commit search results for high-activity users #301

@drb101005

Description

@drb101005

Bug: Commit search only fetches the first page of results

While looking into some inaccurate contribution metrics, I noticed that fetchCommitSearch in route.ts (around line 53) only makes a single GitHub Search API request with per_page=100.

The problem is that GitHub search results are paginated, so for users with more than 100 matching commits we're only processing the first page of data. This causes several metrics to be undercounted or skewed, including:

  • total commits
  • most active repo
  • active contribution days
  • contribution deltas/trends

Proposed fix

Update fetchCommitSearch to paginate through all available search results instead of stopping after the first request.

Suggested approach:

  • Request results with:
    • per_page=100
    • page=N
  • Keep fetching pages until:
    • fewer than 100 items are returned
    • we've reached total_count
    • or we hit GitHub Search API's 1000-result cap
  • Aggregate all returned items before returning the final response

Expected return shape should still look like:

{
  total_count,
  items
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions