open-component-model / ocm

Open Component Model (Software Bill of Delivery Toolset)
https://ocm.software
Apache License 2.0
32 stars 23 forks source link

fast version list command #728

Closed mandelsoft closed 4 months ago

mandelsoft commented 4 months ago

Description

The ocm get cv command can be used to detect and filter existing versions for a component, if the given specification omits a version name. But because the component versions are completely read from the repository to provide additional information fr the output list, it is quite slow.

To just get a list of available versions a new ocm list cv is provided, which can be used just to detect available versions. Also the yaml and json flavors just prvide the found versions and no further information. Therefore, the found versions must not be read from the repository and the list can be determined much faster.

Like for the getcommand a version is only read if a given specification involves a version name to check, whether the version exists.

The version constraint options from the getcommand are supported, also. Therefore, this command can be used to detect available versions according to various constraints, for example the latest version.

What type of PR is this? (check all applicable)

Related Tickets & Documents

Screenshots

Added tests?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

Checklist: