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.
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:
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:
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