Skip to content

feat: Enhance Repository-Specific Contribution Tracking - #8981

Open
Aditya8369 wants to merge 4 commits into
JhaSourav07:mainfrom
Aditya8369:feat/Repository-Specific-Contribution-Monolith
Open

feat: Enhance Repository-Specific Contribution Tracking#8981
Aditya8369 wants to merge 4 commits into
JhaSourav07:mainfrom
Aditya8369:feat/Repository-Specific-Contribution-Monolith

Conversation

@Aditya8369

Copy link
Copy Markdown
Contributor

Summary of Changes
URL Parameter & Schema Validation:

Added repo?: string parameter to baseStreakParamsSchema in

lib/validations.ts
with strict owner/repository-name format validation.
Added repo?: string to BadgeParams and RepoContribution in

types/index.ts
.
GraphQL Scoping & GitHub Fetcher:

Updated FetchOptions and cacheKey in

lib/github.ts
to isolate cache keys per repository (:repo:owner/repo).
Extended the commitContributionsByRepository GraphQL query in fetchContributionsUncached to query contributions(first: 100) { totalCount nodes { occurredAt commitCount } }.
Implemented calendar filtering so that when options.repo is provided, contribution counts per day, total contributions, and repository lists are scoped strictly to the specified repository.
API Route & Title Generation:

Updated

app/api/streak/route.ts
to parse repo and pass it down to fetchGitHubContributions.
Dynamically updated default SVG title to "CommitPulse for owner/repo" when &repo= is provided (unless overridden by custom_title).
Testing:

Added unit tests in

tests/repo-contribution.test.ts
covering parameter validation, cache key generation, and contribution scoping.
Verified that all 6 tests in tests/repo-contribution.test.ts and all 103 tests in lib/github.test.ts pass cleanly.

closes #8977

Copilot AI lite review requested due to automatic review settings August 9, 2026 15:31
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@Aditya8369 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

This pull request significantly enhances the contribution tracking capabilities by scoping contributions to specific repositories and improving validation mechanisms. It aligns well with previous decisions, such as implementing GitHub GraphQL rate limit handling and adding TypeScript validation for the streak route. These improvements will help maintain system stability and user experience. Thank you for your contributions!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@retenta-bot retenta-bot Bot changed the title feat: Repository-Specific Contribution Monolith feat: Enhance Repository-Specific Contribution Tracking Aug 9, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Aug 9, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Hey @Aditya8369, this pull request has been inactive for 3 days. It will be automatically closed in 2 days if no further activity occurs.

If you are still working on this, please push your latest changes or leave a comment to keep it active.

@Aamod007 Aamod007 added mentor:Aamod007 type:feature New features, additions, or enhancements level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing. labels Aug 13, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fantastic feature enhancement! Allowing users to scope their contribution monolith to a specific repository via the &repo=\ parameter adds a lot of value.

Refining the \streakParamsSchema\ in \�alidations.ts\ to enforce the \owner/repo\ format prevents malformed requests early. I also really appreciate how thoroughly you handled the \ etchGitHubContributions\ logic to correctly recalculate \ otalContributions\ and zero out non-matching days in the \contributionCalendar\ when a repo is specified. The
epo-contribution.test.ts\ suite covers all the edge cases perfectly.

Labels applied:

  • type:feature: Adds repository-scoped contribution tracking.
  • level:intermediate: Handles complex GraphQL response transformation and schema validation.
  • quality:exceptional: Clean, robustly tested implementation with good cache key logic.

@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Aug 14, 2026
@Aditya8369

Copy link
Copy Markdown
Contributor Author

@Aamod007 @JhaSourav07

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/3952-[hash].js 7.82 KB 7.78 KB +0.04 KB (+0.53%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 5004.46 KB 5004.32 KB +0.14 KB (+0.00%)
Total CSS 354.80 KB 354.80 KB 0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:intermediate Moderate complexity tasks mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Repository-Specific Contribution Monolith

3 participants