feat: add TTL-based file-backed caching for GitHubCLIProvider#50
Open
Achiever199 wants to merge 1 commit into
Open
feat: add TTL-based file-backed caching for GitHubCLIProvider#50Achiever199 wants to merge 1 commit into
Achiever199 wants to merge 1 commit into
Conversation
10 tasks
Hell1213
requested changes
Jun 1, 2026
Owner
Hell1213
left a comment
There was a problem hiding this comment.
Review: TTL-based caching for GitHubCLIProvider
Hi @Achiever199, great implementation! The cache is well-structured with 22 tests covering TTL, disk persistence, invalidation, and disabled mode. Tests pass (94/94).
Issues to fix (ruff F401/F841):
src/oss_dev/providers/cache.py:12-import osis unused (the code uses pathlib instead)tests/providers/test_cache.py:13-MagicMockimported but unused (onlypatchis used)tests/providers/test_cache.py:91- Variablekeyassigned but never usedtests/providers/test_cache.py:193,210,227,240,256,272- Each test importsGitHubCLIProviderlocally, but_make_provider()already imports it. The per-test imports are redundant and trigger F401. Remove them.
Conflict notice: PR #54 by @Jiya3177 also modifies src/oss_dev/providers/github/client.py (adds rate limit awareness). Both change _run_gh and class internals. The author who merges second will need to rebase and reconcile.
Suggestion: Consider whether you want _run_gh_cached to also respect rate limits (from PR #54) once both are merged.
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
Closes #35
Adds an optional caching layer to
GitHubCLIProviderto avoidredundant
ghCLI calls within and across sessions.Changes
New file:
src/oss_dev/providers/cache.pyCacheEntry— stores value + expiry timestampResponseCache— two-layer cache (memory + disk)make_key()uses SHA-256 hashing for safe filenamesModified:
src/oss_dev/providers/github/client.py_run_gh_cached()helper for read-only callsfetch_issue,list_issues,get_pr_status,get_pr_commentscreate_printentionally bypasses cache (mutating operation)config.cache.enabled / ttl / dirNew file:
tests/providers/test_cache.pyinvalidation, provider integration