fix(api): paginate GitHub App installation repositories#65
Open
woosal1337 wants to merge 1 commit into
Open
Conversation
listInstallationRepos fetched a single page of /installation/repositories with per_page=100, so an installation with more than 100 accessible repos was silently truncated to the first 100 — the dashboard, and every caller that flows through getHome / listReposForOwner, could not see or select the rest. Walk every page until the response's total_count is reached (hard-capped at 100 pages) so all accessible repositories are returned.
|
Would it be better to preserve pagination through the API and UI rather than eagerly fetching every repository? This fixes the current 100-repository truncation, but it instead moves the ceiling to 10k repos which can end in a really large amount of returned repos. Is there a reason the repo picker needs the entire list at once rather than supporting paginated or incremental loading? |
Member
|
please add the ui part at the end of /library page so we can make use of this |
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.
Summary
GitHubAppSource.listInstallationReposmade a singleGET /installation/repositories?per_page=100request, so an App installation with more than 100 accessible repositories was silently truncated to the first 100. Everything downstream —getHome,listReposForOwner, and the dashboard's repo picker — could only ever see those first 100, so a user's newer repos were unselectable.Fix
Walk every page (
per_page=100, incrementingpage) until the response'stotal_countis reached, hard-capped at 100 pages (10k repos) as a safety bound.ghFetchalready serializesparamsinto the GET query string, so no other change is needed.Testing
bun run --cwd apps/api lintpasses (tsc --noEmit).