Repository navigation
Repositories page: local, GitHub, GitLab and combined views - #35
Merged
Merged
Conversation
…bined views The Repositories page now has Combined, Local, GitHub and GitLab tabs (kept in the URL as ?source=). Combined joins each local clone with the GitHub/GitLab repos its remotes point at, collapsing clones of the same remote into one row. Local keeps the existing full table. - lib/catalog: pure merge of clones with host listings (union-find over remote keys; only a clone's preferred remote per host is followed) - server: list the token user's GitHub repos and GitLab projects (paginated, cached for 5 minutes, failures reported per host without breaking the rest) - GitLab listing uses new optional GITLIB_GITLAB_TOKEN, or a username for public projects; contributions.ts now shares the GitLab env helpers - docs/env/compose updated; tests for the merge and the listing code Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…k in the background The Repositories page used to fetch the full GitHub and GitLab inventory into a 5-minute in-memory cache, so every restart or expiry cost a full listing. - Listings are stored per host in a new remote_repo_listings table and read from there on every view; no host call per page load, and they survive restarts - The server re-checks a host when its list is missing or older than GITLIB_REPO_REFRESH_HOURS (default 6, 0 = only the Refresh button), on page load and via a 15-minute timer; the UI polls while a first fetch runs - Checks send each page's ETag; a 304 reuses the stored page and costs no GitHub quota. Refresh fetches complete lists - A failed check keeps the stored list on screen with the error and pauses automatic retries for 30 minutes; a list for another account/host is ignored - Catalog logic moves to catalog.server.ts so it stays out of the client bundle - Tests for the store, ETag paging, stored-listing parsing and the end-to-end flow (first load, restart, recheck, failure, interval 0) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What changed
The Repositories page now has Combined, Local, GitHub and GitLab tabs (kept in the URL as
?source=), so the app is no longer limited to local clones when hosted on a server.GITLIB_GITHUB_TOKEN. GitLab uses a new optionalGITLIB_GITLAB_TOKEN(read_api, member projects), orGITLIB_GITLAB_USERNAMEfor public projects, plusGITLIB_GITLAB_URLif self-hosted.Why stored lists, not fetched per view
Host lists are saved in a new
remote_repo_listingstable ingitlib.dband read from there, so a page load never calls GitHub or GitLab and the lists survive restarts.GITLIB_REPO_REFRESH_HOURS(default 6,0= only the Refresh button), on page load and via a 15-minute timer.304reuses the stored page and costs no GitHub quota. Refresh ignores ETags and fetches complete lists.GITLIB_GITLAB_URL) is ignored.Notes for reviewers
catalog.server.ts;catalog.tsonly holds the server functions. Exporting logic from the server-function file leaked server-only code into the client bundle, so keep them split.apps/web/src/lib/catalog.ts(union-find over remote keys). Only a clone's preferred remote per host is followed, so a fork'supstreamisn't pulled in.gitlib.dbis included in backups, so the stored lists (including private repo names) will be too.Testing
npm test(220 tests) and the web typecheck pass. New tests cover the merge logic, GitHub/GitLab paging and ETag revalidation (withfetchstubbed), the store table, and the full flow: first load, restart, recheck, failure, interval 0.