Skip to content

fix: recover single-user contribution queries with bounded windows - #78

Merged
rogerchappel merged 1 commit into
mainfrom
fix/single-user-contribution-windows
Oct 10, 2026
Merged

rogerchappel merged 1 commit into
mainfrom
fix/single-user-contribution-windows

Conversation

@rogerchappel

Copy link
Copy Markdown
Owner

Summary

  • Weekly run 38085075491 recovered failed batches but stopped when GitHub rejected colinhacks' one-year contribution query even as a single-user request. Add bounded date-window recovery for exhausted single-user gateway/resource failures.
  • GitHub documents inclusive contribution boundaries. Query overlapping windows and their intersection, then combine only commit and pull-request event totals as left + right - overlap. This avoids guessing timestamp precision; repository, gist and follower totals are retained once. Reference: https://docs.github.com/en/graphql/reference/users#contributionscollection
  • Limit recovery to three split levels (at most 21 additional window queries per contributor, each subject to existing request retries). Rate limits never trigger subdivision. Abort on failed required windows, inconsistent overlap counts, invalid counts or user identity changes.
  • Log request windows, split boundaries/depth and exhaustion reason. Recognize the structured RESOURCE_LIMITS_EXCEEDED error type as well as the existing message.

Verification

  • Tests or checks run: seven new window-recovery regressions; all 28 unit tests; full bash scripts/validate.sh including typecheck, burst checks, fixture validation, site/CLI builds, CLI smoke and package smoke; git diff --check.
  • Manual review completed: inclusive-boundary algebra, bounded recursion, sequential requests, failure propagation, safe logs and generated fixture cleanup.

Risk Level

  • Low
  • Medium
  • High

Notes: Tests cover overlap endpoints, adjacent milliseconds, leap day, same-repository contributions, gateway/resource failures, overlap failure and invalid counts. No live query has established that smaller windows resolve colinhacks' resource limit. Separate API calls cannot guarantee an immutable snapshot. Existing country checkpoint behavior is unchanged. No live refresh, deployment or credential changes were performed.

Rollback Plan

  • Close this draft without merging, or revert the single fix commit if merged.

Human Decision Needed

  • None
  • Maintainer review
  • Product/design decision
  • Security/privacy review
  • Other:

@rogerchappel
rogerchappel marked this pull request as ready for review October 10, 2026 21:06
@rogerchappel
rogerchappel merged commit 5a4e6ba into main Oct 10, 2026
1 check passed
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.

1 participant