Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework adding elements to a component version #844

Merged
merged 9 commits into from
Jul 30, 2024

Conversation

mandelsoft
Copy link
Contributor

@mandelsoft mandelsoft commented Jul 14, 2024

What this PR does / why we need it:

The previous mechanism for adding elements (resources, sources and references) to a component version
provided a hybrid mechanism, only:

  • check if an element with the given identity already exists -> replace it
  • if no entry is found -> append

This behaviour does not allow to add elements with the same base identity but a different version, if the version
is not explicitly added to the extra identity.
So, far this explicit handling of the version is not required, because it is implicitly done when evaluating the element list.

This PR add new options to the Set methods for the three element kinds on the component version access to specify the exact desired behaviour:

  • Replace a dedicated index
  • Replace a dedicated identity
  • Update an existing entry
  • Append a new entry

The default behaviour is unchanged. It is sufficient for the most common use cases, as long as no
duplicate entries with different versions should be added.

The CLI commands have been adjusted to use the Append mode by default. This is exactly what is desired if new component versions are composed.
If an existing version should be modified, it is possible to use the option -R to switch to the default mode.

Which issue(s) this PR fixes:

Fixes #842

@mandelsoft mandelsoft requested a review from fabianburth July 14, 2024 13:04
@mandelsoft mandelsoft added the area/ipcei Important Project of Common European Interest label Jul 20, 2024
@fabianburth fabianburth merged commit 01d61d4 into open-component-model:main Jul 30, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei Important Project of Common European Interest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpectedly added version property to extraIdentity
3 participants