Skip to content

Perf: Refactor Updater to use Lightweight Contribution Counters #9063

@tobiu

Description

@tobiu

The current Updater fetches contributionCalendar { totalContributions } for every year of a user's history. This forces GitHub to compute the daily contribution graph, leading to frequent 502 Bad Gateway errors and slow performance.

Optimization:
Replace contributionCalendar with the lightweight aggregated counters available directly on contributionsCollection:

  • totalCommitContributions
  • totalIssueContributions
  • totalPullRequestContributions
  • totalPullRequestReviewContributions
  • restrictedContributionsCount (optional check)

Logic:
Yearly Total = Sum(Counters)

Benefits:

  1. Stability: Drastically reduces load on GitHub's GraphQL API, eliminating 502 errors.
  2. Performance: Significantly faster data fetching.
  3. Future-Proofing: Opens the door to tracking "Commits vs. Total" metrics separately in the future.

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestperformancePerformance improvements and optimizations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions