Skip to content

Move interfaces.LRU to lru.LRU#11566

Merged
iain-macdonald merged 3 commits intomasterfrom
im/ee587519921
Mar 12, 2026
Merged

Move interfaces.LRU to lru.LRU#11566
iain-macdonald merged 3 commits intomasterfrom
im/ee587519921

Conversation

@iain-macdonald
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2026 19:43
Copy link
Contributor

Copilot AI left a comment

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 relocates the generic LRU cache interface from server/interfaces into the server/util/lru package and updates callers to reference the new lru.LRU[...] type, decoupling most code from the concrete LRU implementation.

Changes:

  • Moved the LRU[V] interface definition from server/interfaces/interfaces.go to server/util/lru/lru.go.
  • Updated lru.NewLRU to return the lru.LRU[V] interface and made the concrete implementation unexported.
  • Updated multiple caches and helpers to use lru.LRU[...] instead of interfaces.LRU[...] / *lru.LRU[...].

Reviewed changes

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

Show a summary per file
File Description
server/util/lru/lru.go Introduces exported LRU interface in-package, makes implementation unexported, and changes NewLRU to return the interface.
server/util/claims/claims.go Switches claims parser cache field to lru.LRU[*Claims].
server/interfaces/interfaces.go Removes the LRU interface from the shared interfaces package.
server/backends/memory_cache/memory_cache.go Updates in-memory cache ledger to depend on lru.LRU[[]byte].
server/backends/disk_cache/disk_cache.go Updates disk cache partition ledger to use lru.LRU[*fileRecord].
enterprise/server/util/oci/oci.go Updates resolver tag->digest cache type to lru.LRU[...].
enterprise/server/remoteauth/remoteauth.go Updates remote-auth JWT cache type to lru.LRU[string].
enterprise/server/remote_execution/filecache/filecache.go Updates filecache LRU field type to lru.LRU[*entry].
enterprise/server/remote_execution/copy_on_write/copy_on_write.go Updates mmap LRU field type to lru.LRU[*Mmap].
enterprise/server/remote_execution/containers/podman/podman.go Updates image-existence cache to lru.LRU[time.Time].
enterprise/server/oci/ocifetcher/ocifetcher.go Updates puller LRU field type to lru.LRU[*pullerLRUEntry].
enterprise/server/iprules/iprules.go Updates IP rule cache to lru.LRU[*ipRuleCacheEntry].
enterprise/server/backends/distributed/distributed.go Updates lookaside cache to lru.LRU[lookasideCacheEntry].
enterprise/server/backends/authdb/authdb.go Updates API key group cache to lru.LRU[*apiKeyGroupCacheEntry].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

iain-macdonald and others added 2 commits March 12, 2026 12:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iain-macdonald iain-macdonald merged commit 4c0ac24 into master Mar 12, 2026
9 of 12 checks passed
@iain-macdonald iain-macdonald deleted the im/ee587519921 branch March 12, 2026 19:54
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.

3 participants