fix(repos): paginate repo-explorer to fetch all repos beyond 100 limit (#2843)#3133
Open
BCA-krishna wants to merge 1 commit into
Open
fix(repos): paginate repo-explorer to fetch all repos beyond 100 limit (#2843)#3133BCA-krishna wants to merge 1 commit into
BCA-krishna wants to merge 1 commit into
Conversation
The repo-explorer endpoint was calling /user/repos?per_page=100 once, returning at most 100 repositories. Users with more than 100 repos saw an incomplete list on the dashboard. Changes: - Replace single fetch in repo-explorer/route.ts with fetchUserRepos() which already paginates up to 10 pages (1000 repos max) using the existing pagination helper in src/lib/github.ts - Add missing created_at and language fields to GitHubRepo interface so the type accurately reflects the GitHub API response shape - Update test/github.test.ts mock objects to include the new fields Closes Priyanshu-byte-coder#2843
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2843
Problem
The repo-explorer endpoint called
/user/repos?per_page=100once,returning at most 100 repositories. Users with more than 100 repos
saw an incomplete list on the dashboard, and metrics derived from
that list (PR counts, streak) were also incomplete.
Fix
fetch()call inrepo-explorer/route.tswiththe existing
fetchUserRepos()helper fromsrc/lib/github.ts, whichalready paginates up to 10 pages (1000 repos maximum).
created_atandlanguagefields to theGitHubRepointerface so the type accurately reflects the GitHub API response.
Testing
npm run type-check— 0 errorsnpm run lint— 0 errors