feat: Cache paginated GitHub tags per repository #40
Open
nikolaik wants to merge 1 commit into
Open
Conversation
645ec13 to
86c36c0
Compare
86c36c0 to
9d17747
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds per-repository caching of GitHub tag pagination results in github.Service so multiple module lookups against the same owner/repo can reuse one aggregated tags fetch within a TTL, instead of re-walking every page each time.
Changes:
- Introduces a generic
mcache.Noopcache implementation to allow disabling caching while still satisfying a Get/Set-style interface. - Refactors
github.Service.ListVersionsto fetch all tag names via a newlistTagshelper and caches those tag names perowner/repo. - Updates server wiring and expands GitHub service tests to cover caching and pagination behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/mcache/mcache.go | Adds a no-op cache implementation to make caching optional via interface injection. |
| pkg/github/github.go | Adds TagCache, injects it into Service, and caches aggregated tag names per repository. |
| pkg/github/github_test.go | Updates constructor usage and adds tests for per-repo caching and multi-page pagination. |
| cmd/server/main.go | Wires an in-memory tag cache (or a no-op cache when disabled) into the GitHub service. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d17747 to
309cf72
Compare
Aggregate and cache all tag pages per owner/repo in github.Service so multiple modules sharing a repo (and repeated calls within the TTL) reuse a single paginated fetch instead of re-walking every page.
309cf72 to
c7ae49c
Compare
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.
Aggregate and cache all tag pages per owner/repo in github.Service so
multiple modules sharing a repo (and repeated calls within the TTL) reuse
a single paginated fetch instead of re-walking every page.