Skip to content

fix(api): paginate GitHub App installation repositories#65

Open
woosal1337 wants to merge 1 commit into
oblien:mainfrom
woosal1337:fix/github-repos-pagination
Open

fix(api): paginate GitHub App installation repositories#65
woosal1337 wants to merge 1 commit into
oblien:mainfrom
woosal1337:fix/github-repos-pagination

Conversation

@woosal1337

Copy link
Copy Markdown
Contributor

Summary

GitHubAppSource.listInstallationRepos made a single GET /installation/repositories?per_page=100 request, 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, incrementing page) until the response's total_count is reached, hard-capped at 100 pages (10k repos) as a safety bound. ghFetch already serializes params into the GET query string, so no other change is needed.

Testing

  • bun run --cwd apps/api lint passes (tsc --noEmit).
  • On an account with >100 repos accessible to the installation, the repo list now returns all of them instead of the first 100.

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.
@valgardg

valgardg commented Jul 21, 2026

Copy link
Copy Markdown

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?

@Hydralerne

Copy link
Copy Markdown
Member

please add the ui part at the end of /library page so we can make use of this

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.

3 participants