Migrate custom OCI types to ocispec in oci/skills#26
Merged
Conversation
Replace the dual type system where the packager used ocispec types internally but the store, registry, and helpers used custom types (ImageConfig, ImageIndex, IndexDescriptor, Platform). This eliminates friction like needing JSON re-serialization between the packager's ocispec.Image and the store's ImageConfig. Removed 7 custom struct types and 5 redundant media type constants in favor of their ocispec equivalents. Updated ParsePlatform to support os/arch/variant format, and replaced Platform.String() method with PlatformString() free function. Also fixed platform variant propagation in packager config and index construction, and added -copyright_file to mockgen directives so generated mocks include SPDX headers. Closes #24 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rdimitrov
approved these changes
Feb 7, 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
ImageConfig,ImageConfigData,RootFS,HistoryEntry,ImageIndex,IndexDescriptor,Platform) with theirocispecequivalents (ocispec.Image,ocispec.ImageConfig,ocispec.RootFS,ocispec.History,ocispec.Index,ocispec.Descriptor,ocispec.Platform)MediaTypeImageIndex,MediaTypeImageManifest,MediaTypeImageConfig,MediaTypeImageLayer,AnnotationCreated) — callers now useocispec.*directlyParsePlatformto supportos/arch/variantformat (e.g.,linux/arm/v7)Platform.String()method withPlatformString(ocispec.Platform)free function-copyright_filetomockgendirectives so regenerated mocks include SPDX headersCloses #24
Test plan
PlatformString/ParsePlatformlinux/arm/v7, empty variant)task(lint + test) passestask license-checkpassestask genproduces mocks with proper SPDX headers🤖 Generated with Claude Code