fix: preserve daily contribution totals #7

Merged
magndotcc merged 3 commits from t3/fix-commit-graph-display into main 2026-10-11 19:21:04 +00:00
Owner

What this fixes

The Forgejo heatmap API returns one entry per contribution timestamp. The graph aggregation used to overwrite entries from the same day, so a day with 51 contributions could display only the final entry (for example, 1). This made the graph much lower than GitHub's view.

This change:

  • adds Forgejo entries together by calendar date
  • scans all public GitHub repositories instead of only the ten most recently pushed repositories when no token is configured
  • bumps the KV activity key so the old seven-day snapshot is discarded after deployment

GitLab being offline is handled by the existing failure path. Its offline HTML response is ignored, while Forgejo and GitHub data continue to populate the graph.

Verification

  • bun run typecheck
  • git diff --check
  • Checked the live Forgejo heatmap: October 9 has five entries totaling 51; the old code kept only 1.
  • Checked the live GitLab calendar endpoint: it returns the expected offline HTML page with HTTP 200.
## What this fixes The Forgejo heatmap API returns one entry per contribution timestamp. The graph aggregation used to overwrite entries from the same day, so a day with 51 contributions could display only the final entry (for example, 1). This made the graph much lower than GitHub's view. This change: - adds Forgejo entries together by calendar date - scans all public GitHub repositories instead of only the ten most recently pushed repositories when no token is configured - bumps the KV activity key so the old seven-day snapshot is discarded after deployment GitLab being offline is handled by the existing failure path. Its offline HTML response is ignored, while Forgejo and GitHub data continue to populate the graph. ## Verification - `bun run typecheck` - `git diff --check` - Checked the live Forgejo heatmap: October 9 has five entries totaling 51; the old code kept only 1. - Checked the live GitLab calendar endpoint: it returns the expected offline HTML page with HTTP 200.
Author
Owner

Follow-up fix: the authenticated GitHub path now uses contributionCalendar, which matches the daily totals shown on GitHub profiles. The previous query counted only commit contributions, so GitHub's pull requests, issues, reviews, and discussions were missing. bun run typecheck and git diff --check pass.

Follow-up fix: the authenticated GitHub path now uses `contributionCalendar`, which matches the daily totals shown on GitHub profiles. The previous query counted only commit contributions, so GitHub's pull requests, issues, reviews, and discussions were missing. `bun run typecheck` and `git diff --check` pass.
Author
Owner

Follow-up: the activity total and markdown page now say “contributions” instead of “commits”, matching GitHub's calendar semantics. The activity cache key is bumped again so deployments cannot serve the previous schema.

Follow-up: the activity total and markdown page now say “contributions” instead of “commits”, matching GitHub's calendar semantics. The activity cache key is bumped again so deployments cannot serve the previous schema.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
magndotcc/blog!7
No description provided.