Skip to content

fix(transfer): support Docker manifest media types in OCI-compliant manifest detection#2657

Merged
jakobmoellerdev merged 4 commits into
open-component-model:mainfrom
jakobmoellerdev:fix/docker-manifest-transfer
Jun 3, 2026
Merged

fix(transfer): support Docker manifest media types in OCI-compliant manifest detection#2657
jakobmoellerdev merged 4 commits into
open-component-model:mainfrom
jakobmoellerdev:fix/docker-manifest-transfer

Conversation

@jakobmoellerdev

Copy link
Copy Markdown
Member

What this PR does / why we need it

Docker manifest v2 (application/vnd.docker.distribution.manifest.v2+json) and Docker manifest list (application/vnd.docker.distribution.manifest.list.v2+json) were excluded from isOCICompliantManifest / IsOCICompliantMediaType in both bindings/go/oci/internal/introspection and bindings/go/transfer/internal. This caused LocalBlob resources with Docker manifest media types to silently bypass the OCI artifact upload path when using UploadAsOciArtifact mode during transfer — they were stored as plain local blobs instead.

The root cause was a TODO in both functions noting Docker manifests were not yet supported. This PR resolves that TODO by adding the two Docker distribution manifest media type constants (mirroring oras-go/v2's internal definitions, which are not importable) and extending the switch statements to accept them.

Which issue(s) this PR fixes

Internal report: standard docker manifest transfer broken in v2 transfer path (UploadAsOciArtifact mode).

Testing

How to test the changes
# Unit tests (fast)
cd bindings/go/transfer && go test ./internal/... -run "TestIsOCICompliant|TestBuildGraphDefinition_Docker" -v
cd bindings/go/oci && go test ./internal/introspection/... -v

# Integration test (requires Docker)
cd bindings/go/transfer/integration && go test -v -run Test_Integration_TransferDockerManifestLocalBlob_CTFToOCI
Verification
  • I have added/updated tests for my changes (see Test Requirements)
  • Tests pass locally (task test and task test/integration if applicable)
  • If touching multiple modules, go work is enabled (see go.work)
  • My changes do not decrease test coverage
  • I have tested the changes locally by running ocm

@netlify

netlify Bot commented May 27, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website ready!

Name Link
🔨 Latest commit c7fa42c
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/6a1ffa06b1d3760008983575
😎 Deploy Preview https://deploy-preview-2657--ocm-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added kind/bugfix Bug size/xs Extra small and removed kind/bugfix Bug labels May 27, 2026
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner May 28, 2026 07:49
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@jakobmoellerdev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 17 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbff15dd-08b4-4978-bb25-8798f8045a07

📥 Commits

Reviewing files that changed from the base of the PR and between f87378c and c7fa42c.

📒 Files selected for processing (6)
  • bindings/go/oci/internal/introspection/manifest.go
  • bindings/go/oci/internal/introspection/manifest_test.go
  • bindings/go/transfer/integration/integration_test.go
  • bindings/go/transfer/internal/graph_test.go
  • bindings/go/transfer/internal/helpers.go
  • bindings/go/transfer/internal/helpers_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size/m Medium and removed size/xs Extra small labels May 28, 2026
@jakobmoellerdev jakobmoellerdev force-pushed the fix/docker-manifest-transfer branch from e598f2d to af3c7a3 Compare May 28, 2026 07:50

@matthiasbruns matthiasbruns 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.

conflicts - it works - good job

…anifest detection

Docker manifest v2 and manifest list types were excluded from
isOCICompliantManifest/IsOCICompliantMediaType, causing LocalBlob
resources with Docker manifest media types to silently bypass the
OCI artifact upload path during transfer (UploadAsOciArtifact mode).

Adds Docker distribution media type constants (documented as mirroring
oras-go internal/docker/mediatype.go) and extends the switch in both
oci/internal/introspection and transfer/internal to accept them.

Adds unit tests for the fixed functions and two graph-level tests
verifying Docker LocalBlob routing. Adds an integration test
(Test_Integration_TransferDockerManifestLocalBlob_CTFToOCI) that
pushes a real Docker v2 manifest, transfers it CTF→OCI with
UploadAsOciArtifact, and asserts the target resource has OCIImage
access pointing to the target registry.

On-behalf-of: @SAP <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
On-behalf-of: @SAP <jakob.moeller@sap.com>
The previous test stored raw Docker manifest JSON as a LocalBlob in CTF
and tried to run AddOCIArtifact on it, which failed because AddOCIArtifact
expects an OCI layout TAR, not raw manifest JSON.

Rework to use an OCIImage resource (pointing at a real Docker manifest
in a source registry) with CopyModeAllResources + UploadAsOciArtifact.
This tests the real scenario: Docker manifest images transferred end-to-end
via registry-to-registry copy, landing as OCIImage access in the target.

On-behalf-of: @SAP <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
On-behalf-of: @SAP <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the fix/docker-manifest-transfer branch from af3c7a3 to 7eb35be Compare June 3, 2026 05:30
…et with UploadAsOciArtifact

With CopyModeAllResources + UploadAsOciArtifact + OCI target, the graph
builder takes the streaming path (processOCIArtifactStreaming) which emits
TransferOCIArtifact. The previous assertion checked for GetOCIArtifact,
which is only emitted when the target is not an OCI repository.

Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
On-behalf-of: @SAP <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the fix/docker-manifest-transfer branch from 4c35c1e to 52dbb3d Compare June 3, 2026 06:25
Comment thread bindings/go/oci/internal/introspection/manifest.go
@jakobmoellerdev jakobmoellerdev enabled auto-merge (squash) June 3, 2026 09:55
@jakobmoellerdev jakobmoellerdev merged commit 943dd6f into open-component-model:main Jun 3, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants