Skip to content

Always include layers field, even if there are no layers in ModelKit - #1291

Open
amisevsk wants to merge 1 commit into
kitops-ml:mainfrom
amisevsk:empty-layers
Open

amisevsk wants to merge 1 commit into
kitops-ml:mainfrom
amisevsk:empty-layers

Conversation

@amisevsk

Copy link
Copy Markdown
Contributor

Description

Always include a layers field, potentially empty, rather than excluding it from the manifest, as required by the OCI image spec JSON schema. Previously, packing a ModelKit with no layers would entirely omit the layers field on the manifest, which causes issues in some registries.

Linked issues

N/A

AI-Assisted Code

  • This PR contains AI-generated code that I have reviewed and tested
  • I take full responsibility for all code in this PR, regardless of how it was created

Always include a layers field, potentially empty, rather than excluding
it from the manifest, as required by the OCI image spec JSON schema.

Signed-off-by: Angel Misevski <amisevsk@gmail.com>
@amisevsk
amisevsk requested review from gorkem and a balanced review from Copilot September 30, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused implementation satisfies the OCI requirement and includes effective regression coverage; APPROVE.

Review effort: Balanced
Findings: None

What changed in this PR

Ensures layerless ModelKits remain OCI-compliant by serializing an empty layers array.

Changes:

  • Initializes layer and diff-ID slices as non-nil.
  • Warns when packing a layerless ModelKit.
  • Adds regression coverage for "layers":[].
File Description
pkg/​lib/​filesystem/​local-storage.go Preserves empty layer arrays in manifests.
pkg/​lib/​filesystem/​local-storage_test.go Verifies layerless manifest serialization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
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