Skip to content

feat: Cache paginated GitHub tags per repository #40

Open
nikolaik wants to merge 1 commit into
mainfrom
nikolaik/hissing-oven
Open

feat: Cache paginated GitHub tags per repository #40
nikolaik wants to merge 1 commit into
mainfrom
nikolaik/hissing-oven

Conversation

@nikolaik

Copy link
Copy Markdown

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.

@nikolaik nikolaik force-pushed the nikolaik/hissing-oven branch 2 times, most recently from 645ec13 to 86c36c0 Compare June 25, 2026 09:33
@nikolaik nikolaik marked this pull request as ready for review June 25, 2026 10:58
@nikolaik nikolaik requested a review from a team as a code owner June 25, 2026 10:58
@nikolaik nikolaik force-pushed the nikolaik/hissing-oven branch from 86c36c0 to 9d17747 Compare June 25, 2026 11:27
@nikolaik nikolaik requested a review from Copilot June 25, 2026 11:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Noop cache implementation to allow disabling caching while still satisfying a Get/Set-style interface.
  • Refactors github.Service.ListVersions to fetch all tag names via a new listTags helper and caches those tag names per owner/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.

Comment thread pkg/github/github.go
Comment thread cmd/server/main.go Outdated
@nikolaik nikolaik force-pushed the nikolaik/hissing-oven branch from 9d17747 to 309cf72 Compare June 25, 2026 12:51
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants