Skip to content

feat: add component version command#189

Merged
jakobmoellerdev merged 136 commits into
open-component-model:mainfrom
jakobmoellerdev:add-cv
Jul 7, 2025
Merged

feat: add component version command#189
jakobmoellerdev merged 136 commits into
open-component-model:mainfrom
jakobmoellerdev:add-cv

Conversation

@jakobmoellerdev

Copy link
Copy Markdown
Member

What this PR does / why we need it

see docs/reference/cli/ocm_add_component-version.md for more details

Which issue(s) this PR fixes

fix open-component-model/ocm-project#491

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension area/documentation Documentation related size/l Large labels May 23, 2025
@jakobmoellerdev

Copy link
Copy Markdown
Member Author

Im creating this PR here to start preparing and testing the constructor lib, but this wont be merged for a bit.

This sets up the default constructor library

It is the implementation that is used whenever constructing components with our go bindings.

This is a barebones implementation without any input method.
This means that by default, it cannot process anything.

Only by adding input methods will it become more powerful.

This extension is made possible through the plugin manager / integration with the various provider interfaces (see options.go)
jakobmoellerdev and others added 23 commits May 28, 2025 13:07
# Conflicts:
#	bindings/go/constructor/construct.go
#	bindings/go/constructor/construct_resource_test.go
#	bindings/go/constructor/construct_source_test.go
#	bindings/go/constructor/construct_test.go
#	bindings/go/constructor/input_method_registry.go
#	bindings/go/constructor/input_method_registry_test.go
#	bindings/go/constructor/interface.go
#	bindings/go/constructor/options.go
#	bindings/go/constructor/spec/v1/resources/schema-2020-12.json
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review July 1, 2025 14:59
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner July 1, 2025 14:59

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

I have some initial comments and questions with a first run-through. :)

Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/internal/plugin/builtin/oci/resource_repository.go Outdated
Comment thread cli/internal/sync/map.go
@jakobmoellerdev jakobmoellerdev requested a review from Skarlso July 3, 2025 09:47
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/internal/sync/map.go
@jakobmoellerdev jakobmoellerdev requested a review from Skarlso July 3, 2025 11:40

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

Just a couple of questions really, nothing major. I think this is looking awesome now.

Comment thread cli/internal/plugin/builtin/oci/resource_repository.go Outdated
Comment thread cli/internal/plugin/builtin/oci/resource_repository.go Outdated
Comment thread cli/internal/plugin/builtin/oci/resource_repository.go
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go Outdated
Comment thread cli/cmd/add/component-version/cmd.go Outdated

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

LGTM

@jakobmoellerdev jakobmoellerdev merged commit 5a6e640 into open-component-model:main Jul 7, 2025
19 checks passed
ikhandamirov pushed a commit to ikhandamirov/open-component-model that referenced this pull request Jul 8, 2025
* feat: add component version command

* feat: component constructor library

This sets up the default constructor library

It is the implementation that is used whenever constructing components with our go bindings.

This is a barebones implementation without any input method.
This means that by default, it cannot process anything.

Only by adding input methods will it become more powerful.

This extension is made possible through the plugin manager / integration with the various provider interfaces (see options.go)

* chore: fixup

* chore: fixup

* feat: start adding the basics of constructor registries

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com

* simplified the registry map holding various plugin types

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com

* add tests, endpoint and implementation and handlers

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* finally fixed all the tests

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* lint fixes

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* fix: registry contracts

* chore: fixup the input method repository plugin

* feat: start building out separate digest processor contract

* feat: generate resource registry

* chore: remove resource repo from comp version contract

* chore: fixup contracts

* feat: pass through plugins to constructor

* feat: finally start connecting all the dots

* feat: finally start connecting all the dots

* feat: add scheme copy option

* feat: start adding the basics of constructor registries

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com

* simplified the registry map holding various plugin types

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com

* add tests, endpoint and implementation and handlers

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* finally fixed all the tests

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* lint fixes

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* fix: registry contracts

* chore: fixup the input method repository plugin

* feat: start building out separate digest processor contract

* feat: generate resource registry

* chore: remove resource repo from comp version contract

* added tests and fixed up the handler; registry and plugin incoming next

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* added a registry test and a test plugin for digester

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* extending the test cases

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* try working on surfacing the contracts instead of the plugin contracts

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* adding conversion to digester

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* chore: increase test coverage and add comments

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* added some missing comments

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* Merge remote-tracking branch 'refs/remotes/skarlso/add-construct-registry' into add-cv

# Conflicts:
#	bindings/go/plugin/Taskfile.yml
#	bindings/go/plugin/internal/testplugin-input/main.go
#	bindings/go/plugin/manager/contracts/digestprocessor/v1/contract.go
#	bindings/go/plugin/manager/contracts/digestprocessor/v1/doc.go
#	bindings/go/plugin/manager/contracts/input/v1/types.go
#	bindings/go/plugin/manager/contracts/resource/v1/contracts.go
#	bindings/go/plugin/manager/contracts/resource/v1/types.go
#	bindings/go/plugin/manager/manager.go
#	bindings/go/plugin/manager/registries/componentversionrepository/handlers.go
#	bindings/go/plugin/manager/registries/digestprocessor/endpoints_function.go
#	bindings/go/plugin/manager/registries/digestprocessor/handlers.go
#	bindings/go/plugin/manager/registries/digestprocessor/implementations.go
#	bindings/go/plugin/manager/registries/digestprocessor/registry.go
#	bindings/go/plugin/manager/registries/input/implementations.go
#	bindings/go/plugin/manager/registries/input/registry.go
#	bindings/go/plugin/manager/registries/input/registry_test.go
#	bindings/go/plugin/manager/registries/resource/endpoints_function.go
#	bindings/go/plugin/manager/registries/resource/implementations.go
#	bindings/go/plugin/manager/registries/resource/implementations_test.go
#	bindings/go/plugin/manager/registries/resource/registry.go
#	bindings/go/plugin/manager/registries/resource/registry_test.go
#	bindings/go/plugin/manager/types/types.go
#	bindings/go/runtime/registry.go
#	cli/cmd/generate/docs/cmd.go
#	cli/cmd/get/component-version/cmd.go
#	cli/internal/enum/flag.go
#	cli/internal/flag/enum/flag.go
#	cli/internal/flag/log/flag.go
#	cli/internal/flags/enum/flag.go

* chore: refactor memory blob implementation

reduces one abstraction layer from the memory blob implementation so that it is easier to debug and use. separates the memory blob implementation from the actual blob interface

* feat: start adding the basics of constructor registries

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com

* simplified the registry map holding various plugin types

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: @SAP gergely.brautigam@sap.com

* add tests, endpoint and implementation and handlers

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* finally fixed all the tests

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* lint fixes

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* fix: registry contracts

* chore: fixup the input method repository plugin

* feat: start building out separate digest processor contract

* feat: generate resource registry

* chore: remove resource repo from comp version contract

* added tests and fixed up the handler; registry and plugin incoming next

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* added a registry test and a test plugin for digester

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* extending the test cases

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* try working on surfacing the contracts instead of the plugin contracts

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* adding conversion to digester

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* chore: increase test coverage and add comments

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* added some missing comments

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* using the new construction package

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* feat: latest changes to interfaces and finally easier plugin interfaces

* chore: fixup input registry

* fix: make sure to use correct blobs

* fix: fixup input registry

* fix: fixup constructor

* fix: fixup cache location

* fix: fixup repository

* fix: fixup incorrect conflict strategy

* fix: fixup plugin lookup to use correct defaulting and type derivation

this changes the lookup of the input plugins tro be based purely on the type, and not the prototype that is registered.

* fix: also register all aliases

* feat: add converter for the resource registry

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* feat: add converter for the resource registry

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* fix: ensure CTF artifact index is properly updated without conflicts or duplicates

currently CTF indexes were not maintained correctly because there were cases in which duplicates could show up.

This is has now been corrected and tested

* fix the test

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* adding upload/download resource contract and implementation

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* chore: bumps

* make the external interface read-only

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* chore: bump after merge

* chore: merge back

* chore: fixup

* fix: fixup index lookup

resolved manifests never contain artifact types. as such we have to loosen up our tag resolver so that it can deal with any arbitrary tag

* fix: do not do gc on referrers index for compatibility with non Artifact Compliant Manifests such as ghcr

* fix: add cred graph to resource repo as well as remove unneeded scheme

* feat: introduce digest processing on reference

* feat: add dynamic construction logs and progress indicators

* chore: cleanup logging and introduce log based progress tracking

* fix: ensure runtime is able to deal with generic value sets

* chore: fixup oci

* chore: fixup constructor

* chore: fixup inbuilt

* feat: introduce file input method

* feat: introduce file input method

* feat: introduce file input method

* feat: introduce file input method

* feat: introduce file input method

* feat: allow construction with complex types

* fix: make sure that OCI lib expects only already converted accesses.

because we only use the runtime package in OCI repositories, we shouldn't need to deal with crazy raw to type conversions. Instead any caller should have preconverted types that we assert on

* fix: make sure that OCI lib expects only already converted accesses.

because we only use the runtime package in OCI repositories, we shouldn't need to deal with crazy raw to type conversions. Instead any caller should have preconverted types that we assert on

* fix: fixup constructor

* chore: rebase

* chore: rebase

* chore: prep command

* chore: remove unneeded sleep

* chore: remove unneeded baseurl based repo caching

* chore: add warning to the credential consumer identity lookup

* chore: make sure tracker exists

* fix: make sure trackers are threadsafe

* chore: pr comments

* chore: bump libs

* chore: bump libs

* chore: pr review

* chore: pr review

* chore: pr review

---------

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Ilya Khandamirov <ilya.khandamirov@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Documentation related kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ocm add cv Root Command

3 participants