Repository navigation
Store GitHub community scores in the database - #33
Merged
Merged
Conversation
Scores used to live in a 30-minute in-memory cache and were re-fetched from GitHub on every restart. They now persist in a github_community_profiles table in gitlib.db, keyed by lowercased owner/repo so worktrees share a row. - The repo list and Community tab read stored profiles; no GitHub call per view. - Stale profiles (default 24h, GITLIB_COMMUNITY_REFRESH_HOURS, 0 = off) are refreshed in the background on page load and by an hourly server check, oldest first so a rate-limited run resumes where it stopped. - "Refresh scores" on the repo list and "Refresh" on the Community tab fetch on demand. Rescan no longer touches scores. - A failed refresh keeps stored scores and backs off automatic retries for an hour. 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
Community scores are now persisted in
gitlib.dbinstead of living in a 30-minute in-memory cache that was lost on every restart.github_community_profilestable (created automatically on existing databases), keyed by lowercasedowner/reposo linked worktrees share a row.GITLIB_COMMUNITY_REFRESH_HOURSchanges the interval;0disables automatic refresh.Why
Scores cost one GitHub request per repo, and anonymous access allows only 60 an hour. Storing them makes the table instant and usable offline, and spends requests only on a schedule or on demand.
Reviewer notes
{score, items: {id, present, url}}is stored; labels and hints come from code, so wording changes apply to old rows. Rows missing a checklist item are treated as unusable and re-fetched..env.examplefiles, anddocker-compose.ymlare updated for the new setting.Testing
npm run typecheckandnpm testpass (185 tests), including new tests for the store, stored format, and the interval/staleness helpers.🤖 Generated with Claude Code