Skip to content

feat: Enhance Repository-Specific Contribution Tracking - #8981

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

feat: Enhance Repository-Specific Contribution Tracking#8981
Aditya8369 wants to merge 2 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

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🚨 Hey @Aditya8369, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

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

Labels

status:blocked This PR is blocked due to a failing CI check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Repository-Specific Contribution Monolith

2 participants