Skip to content

Add repository description caching#35

Merged
justinabrahms merged 2 commits into
mainfrom
work/proud-tiger
Jan 22, 2026
Merged

Add repository description caching#35
justinabrahms merged 2 commits into
mainfrom
work/proud-tiger

Conversation

@justinabrahms
Copy link
Copy Markdown
Owner

Summary

Implements application-level caching for repository descriptions to avoid redundant GitHub API calls.

Changes

  • Added GetRepository() method: Fetches individual repositories by owner/repo name
  • Added repoCache map: In-memory application-level cache for repository data
  • Auto-caching: All repositories fetched from GetStarredRepos(), GetStarredReposByUsername(), GetOwnedRepos(), and GetOwnedReposByUsername() are automatically cached
  • Cache management methods: CacheRepository() for pre-populating and ClearRepoCache() for clearing the cache
  • Comprehensive tests: Added 5 new test cases covering caching behavior

Benefits

  1. Reduced API calls: When we need to fetch a repository we've already seen (from starred/owned lists), we use the cached version instead of making another API call
  2. Lower rate limit usage: Fewer API calls mean we stay well under GitHub's rate limits
  3. Faster operations: Cached data returns immediately without network latency
  4. Future-proof: Enables future features that might need individual repo lookups (e.g., enriching event repositories with descriptions)

Test Results

All tests pass - github package tests run in 0.214s with all 27 tests passing.

- Add GetRepository() method to fetch individual repositories
- Add application-level repoCache map to Client struct
- Cache repositories as we encounter them from starred/owned repos
- Add CacheRepository() method for pre-populating cache
- Add ClearRepoCache() method for clearing cache
- Add comprehensive tests for caching behavior
- Prevents redundant API calls for repository descriptions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@justinabrahms justinabrahms added the multiclaude PR created by multiclaude worker label Jan 22, 2026
@justinabrahms justinabrahms merged commit c69dc82 into main Jan 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiclaude PR created by multiclaude worker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant