Replace custom Store with ORAS oci.Store#27
Merged
Conversation
The custom Store (~280 lines) manually reimplemented OCI Image Layout features: content-addressable blob storage, a custom index.json tag index, mutex-based thread safety, and path helpers. Now that oras-go is a dependency, replace this with the battle-tested content/oci.Store which implements the full OCI Image Layout spec, handles blob dedup, tagging, and is thread-safe internally. This also eliminates the storeAdapter shim in registry.go since oci.Store already implements oras.Target — the new Store.Target() method exposes it directly for use by registry Push/Pull. Key changes: - store.go: Thin wrapper around oci.Store (~210 lines, down from ~280) - registry.go: Remove storeAdapter (~105 lines), use store.Target() - store_test.go: Check for oci-layout instead of manifests/ directory; test manifests now include proper mediaType for ORAS auto-tagging - registry_test.go: Remove storeAdapter tests (no longer exists) Closes #25 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rdimitrov
approved these changes
Feb 8, 2026
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
store.goto wraporas.land/oras-go/v2/content/oci.Storeinstead of manually reimplementing OCI Image Layout features (content-addressable blobs, custom tag index, mutex, path helpers). Net reduction: ~280 → ~210 lines.storeAdapterfromregistry.go(~105 lines). The newStore.Target()method exposes the underlyingoras.Targetdirectly for use byoras.CopyGraph(push) andoras.Copy(pull).oci-layoutfile instead ofmanifests/dir) and propermediaTypefields on test manifests.Why
The custom Store manually reimplemented what
oci.Storealready provides: blob dedup, index.json management, thread safety, and OCI Image Layout compliance. Withoras-goalready a dependency, we can delete ~255 lines of hand-rolled storage code and get a battle-tested implementation that handles edge cases we'd otherwise need to maintain.The
storeAdaptershim was only needed because the old Store didn't implementoras.Target. Sinceoci.Storedoes, the shim is no longer necessary.Test plan
taskpasses (lint + race-detected tests)task license-checkpassesCloses #25
🤖 Generated with Claude Code