Skip to content

Replace custom Store with ORAS oci.Store#27

Merged
JAORMX merged 1 commit into
mainfrom
oci-skills-replace-store-with-oras
Feb 8, 2026
Merged

Replace custom Store with ORAS oci.Store#27
JAORMX merged 1 commit into
mainfrom
oci-skills-replace-store-with-oras

Conversation

@JAORMX

@JAORMX JAORMX commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite store.go to wrap oras.land/oras-go/v2/content/oci.Store instead of manually reimplementing OCI Image Layout features (content-addressable blobs, custom tag index, mutex, path helpers). Net reduction: ~280 → ~210 lines.
  • Remove storeAdapter from registry.go (~105 lines). The new Store.Target() method exposes the underlying oras.Target directly for use by oras.CopyGraph (push) and oras.Copy (pull).
  • Update tests to reflect OCI Image Layout structure (oci-layout file instead of manifests/ dir) and proper mediaType fields on test manifests.

Why

The custom Store manually reimplemented what oci.Store already provides: blob dedup, index.json management, thread safety, and OCI Image Layout compliance. With oras-go already 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 storeAdapter shim was only needed because the old Store didn't implement oras.Target. Since oci.Store does, the shim is no longer necessary.

Test plan

  • task passes (lint + race-detected tests)
  • task license-check passes
  • All existing store tests updated and passing (PutBlob/GetBlob, PutManifest/GetManifest, Tag/Resolve, ListTags, GetIndex, IsIndex, TagOverwrite)
  • All existing registry push/pull round-trip tests passing (manifest and index)
  • Packager tests passing (Package, Reproducible, VerifyManifest, VerifyLayer, MultiPlatform)
  • Cross-checked against skillet e2e flow for compatibility

Closes #25

🤖 Generated with Claude Code

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>
@JAORMX JAORMX merged commit f450f5a into main Feb 8, 2026
5 checks passed
@JAORMX JAORMX deleted the oci-skills-replace-store-with-oras branch February 8, 2026 07:33
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.

Replace custom Store with ORAS oci.Store

2 participants