Skip to content

[pull] main from open-component-model:main#411

Merged
pull[bot] merged 2 commits into
Skarlso:mainfrom
open-component-model:main
Jun 3, 2026
Merged

[pull] main from open-component-model:main#411
pull[bot] merged 2 commits into
Skarlso:mainfrom
open-component-model:main

Conversation

@pull

@pull pull Bot commented Jun 3, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…anifest detection (#2657)

#### 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

```bash
# 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

- [x] I have added/updated tests for my changes (see [Test
Requirements](../CONTRIBUTING.md#test-requirements))
- [x] Tests pass locally (`task test` and `task test/integration` if
applicable)
- [ ] If touching multiple modules, `go work` is enabled (see `go.work`)
- [x] My changes do not decrease test coverage
- [ ] I have tested the changes locally by running `ocm`

---------

Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
…sourceStream (#2723)

## Summary

- `UploadResourceStream` previously rejected all references except
tagged ones (Form C: `repo:tag`) due to a `ValidateReferenceAsTag()`
guard — this blocked digest-only (Form A: `repo@sha256:...`) and OCM
tag+digest references (`repo:tag@sha256:...`) from uploading
- The guard also made the digest-pinning code added in this branch
unreachable: for Form C, `ref.Reference.Reference` is always the tag
string (non-empty), so the `if ref.Reference.Reference == ""` pin branch
was never entered
- Replaced the guard with a tag-or-digest check: only bare repository
references with neither tag nor digest are rejected

## Changes

- `bindings/go/oci/repository.go`: relax guard from
`ValidateReferenceAsTag()` to `ref.Tag == "" &&
ref.ValidateReferenceAsDigest() != nil`
- `bindings/go/oci/repository_test.go`: add
`TestRepository_UploadResourceStream` with 4 table-driven cases covering
all reference forms

## Test plan

- [ ] `go test ./... -count=1` passes in `bindings/go/oci`
- [ ] tag-only ref: tag preserved, resource digest applied
- [ ] digest-only ref: digest preserved, no tag call issued
- [ ] OCM tag+digest ref: both preserved (previously blocked by old
guard)
- [ ] bare repo ref: rejected with `"can only upload ... if it has a tag
or digest"` error

---------

Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
@pull pull Bot locked and limited conversation to collaborators Jun 3, 2026
@pull pull Bot added the ⤵️ pull label Jun 3, 2026
@pull pull Bot merged commit 17db1eb into Skarlso:main Jun 3, 2026
@github-actions github-actions Bot added the size/m label Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant