Skip to content

Fix inaccurate commit counts and forked repo stats#4

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-inaccurate-api-results
Draft

Fix inaccurate commit counts and forked repo stats#4
Copilot wants to merge 4 commits intomainfrom
copilot/fix-inaccurate-api-results

Conversation

Copy link

Copilot AI commented Dec 5, 2025

GitHub stats were inaccurate due to: (1) commit counts using all-time data instead of year-specific, (2) forked repos inflating stars/forks/language metrics, and (3) timezone issues in streak calculation.

Year-Specific Commit Count

  • Added getYearCommitCount() using GraphQL contributionsCollection API
  • Replaced REST /repos/{owner}/{repo}/contributors endpoint which returns all-time counts
// Now fetches year-specific commits via GraphQL
const totalCommits = await getYearCommitCount(username, year, userToken);

Forked Repos Exclusion

  • Filtered nonForkedRepos for stats that should reflect user's original work:
    • Stars/forks received
    • Language breakdown
    • Top repos rankings
    • Per-repo commit analysis

Commit Streak Timezone Fix

  • Replaced new Date(dateString) parsing with pure arithmetic
  • Added parseDateString() returning YYYYMMDD numeric format with validation
  • Added areConsecutiveDays() handling month/year boundaries and leap years correctly

Minor

  • Fixed case-sensitive username matching in contributor lookup
  • Fixed typo: generateComedic CommentarygenerateComedicCommentary
Original prompt

This section details on the original issue you should resolve

<issue_title>Slightly Innacurate results by the app</issue_title>
<issue_description>The Api results sightly differ from the actual values, especally the forked repos stats, the commit streak etc.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
github-wrapped Ready Ready Preview Comment Dec 5, 2025 0:32am

Co-authored-by: mikesplore <123598731+mikesplore@users.noreply.github.com>
Co-authored-by: mikesplore <123598731+mikesplore@users.noreply.github.com>
Co-authored-by: mikesplore <123598731+mikesplore@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inaccurate results from API Fix inaccurate commit counts and forked repo stats Dec 5, 2025
Copilot AI requested a review from mikesplore December 5, 2025 00:36
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.

Slightly Innacurate results by the app

2 participants

Comments