Skip to content

docs(conventions): define artefact-linking label convention - #146

Draft
bedirhan-yilmaz wants to merge 3 commits into
open-component-model:mainfrom
bedirhan-yilmaz:feat/artefact-linking-label-convention
Draft

docs(conventions): define artefact-linking label convention#146
bedirhan-yilmaz wants to merge 3 commits into
open-component-model:mainfrom
bedirhan-yilmaz:feat/artefact-linking-label-convention

Conversation

@bedirhan-yilmaz

@bedirhan-yilmaz bedirhan-yilmaz commented Jul 15, 2026

Copy link
Copy Markdown

What this PR does / why we need it

Adds a convention to the OCM spec for expressing cross-artefact relationships via labels. This allows a derived resource (e.g. an SBoM) to declare which subject resource it relates to within the same component version, using a structured label placed on the derived artefact.

Which issue(s) this PR is related to

Fixes open-component-model/open-delivery-gear#126

…ationships

Signed-off-by: Bedirhan Yilmaz (bedirhan-yilmaz) <bedirhan.yilmaz@sap.com>
Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
Signed-off-by: Bedirhan Yilmaz (bedirhan-yilmaz) <bedirhan.yilmaz@sap.com>
type: sbom
extraIdentity:
architecture: arm64
labels:

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.

      - name: ocm.software/artefactReferences # check whether we want different conventions than camel case
        version: v1
        value:
          - identity:
              name: my-image
              version: 1.2.3
              foo: bar
            metadata: # once we need it

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.

even for in-house labels, we might want to prefix with ocm.software

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If we want to follow conventions on K8s annotations & labels, it would be good to have ocm.software as a prefix :-)

Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
Comment thread doc/01-model/06-conventions.md Outdated
…e structure

Signed-off-by: Bedirhan Yilmaz (bedirhan-yilmaz) <bedirhan.yilmaz@sap.com>
@bedirhan-yilmaz
bedirhan-yilmaz force-pushed the feat/artefact-linking-label-convention branch from ee2a87e to ef044c9 Compare July 28, 2026 11:31
@bedirhan-yilmaz

Copy link
Copy Markdown
Author

Since the K8S docs and ODG labels uses kebab-case, I suggest we take the same approach for the label format

@bedirhan-yilmaz
bedirhan-yilmaz requested a review from 8R0WNI3 July 28, 2026 11:38
Comment thread doc/01-model/06-conventions.md
### Label Name

```
ocm.software/artefact-references

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.

nit: Do we think we will move towards a new spec version with artifacts instead of resources and sources soon? Currently, it seems rather like we will deprecate sources and keep the rest of the spec. So maybe ocm.software/resource-references would be more fitting?

- The set of additional key-value pairs MUST exactly match the subject's `extraIdentity`:
every key in the `identity` entry MUST be present and equal in the subject's `extraIdentity`,
and the subject's `extraIdentity` MUST NOT contain any keys not present in the `identity` entry.
5. Resources that pass all checks are companions of the subject.

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.

nit: the term "companion" is used nowhere else to describe this relationship, might be confusing


```regexp
[a-z][a-zA-Z0-9]*
ocm\.software/[a-z][a-z0-9-]*

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.

Do we think this regex is sufficient? Maybe we rather mention that our guidance is to confirm to the k8s label syntax and character set (and not even specify a concrete regex).

and is appended, separated by a slash (`/`).
organization (for example `odg.ocm.software/binary-scan-policy`).
The local name MUST use kebab-case and is appended, separated by a slash (`/`).

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.

nit: might want to restructure a little bit as the dns prefix convention now also applies to the predefined labels

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.

Define OCM artefact reference label contract

5 participants