Skip to content

Commit 1f92d7b

Browse files
Apply suggestions from code review
Co-authored-by: Simon Gerber <[email protected]>
1 parent ead2e78 commit 1f92d7b

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

docs/modules/SDDs/pages/0033-commodore-component-instance-versioning.adoc

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
= SDD 0033 - Commodore Component Instance Versioning
22

33
:sdd_author: Aline Abler
4-
:sdd_owner: Aline Abler
5-
:sdd_reviewers: SIG
4+
:sdd_owner: Aldebaran
5+
:sdd_reviewers: Simon Gerber
66
:sdd_date: 2025-01-08
77
:sdd_status: draft
88
include::partial$meta-info-table.adoc[]
@@ -24,17 +24,13 @@ Commodore does not currently support specifying different component versions for
2424

2525
* Define how different versions for each component instance can be specified and generated.
2626

27-
=== Non-Goals
28-
29-
30-
3127
== Design Proposal
3228

3329
Commodore will leverage the existing configuration options in `.parameters.components` to retrieve version information for specific instances.
3430
Instance versions can be specified in `.parameters.components.<instance-name>` and override the value specified in `.parameters.components.<component-name>`.
3531
Even if all instances provide their own version, a version for the base component (`.parameters.components.<component-name>`) must still be specified.
3632

37-
Component authors must explicitly declare that their component supports multi-versioning.
33+
Component authors must explicitly declare that their component supports multi-versioning by setting component parameter `_metadata.multi_versioning=true`.
3834
In a valid catalog, all used versions of the same component must advertise this support.
3935

4036
Components with multi-versioning support must ensure they create no file conflicts when downloading dependencies.
@@ -51,24 +47,22 @@ Similarly, if the component includes a Jsonnet library that is made available to
5147
We can clone the repository of the base component and create a separate worktree for each instance to check out the correct version.
5248

5349
If the instance version specifies a different URL from the base component, more work is needed: in this case, we clone the changed repository for the instance and create a worktree from that.
54-
55-
This means that if two instances both override the URL to the same value, this repository is cloned twice, which can impact performance.
56-
However, since this only affects instances which override the repository URL, the impact is tolerable.
50+
We can leverage the existing MultiDependency architecture to avoid cloning the same repository multiple times.
5751

5852
=== Risks and Drawbacks
5953

6054
* Since the Jsonnet dependencies and libraries are all provided from a single component version, there is a risk for some combinations of versions not compiling properly due to version compatibility issues.
6155
** Even if a component's dependencies are sufficiently backwards-compatible at the moment, it's possible for future changes to break compatibility.
6256
This might force a component author to remove multi-version support in higher component versions, causing a catalog to stop compiling if either component instance is updated.
63-
* Overriding the repository URL in a component instance always causes a new repository to be cloned - even if the same URL is used in multiple instances.
6457

6558
== Alternatives
6659

6760
=== Automatically detecting multi-version support
6861

69-
It could be possible to automatically determine whether a component supports multi-versioning, by way of checking whether the `${_base_directory}` parameter is used in the component's compile configuration.
62+
We could try to automatically determine whether a component supports multi-versioning, by way of checking whether the `${_base_directory}` parameter is used in the component's compile configuration and for Jsonnet expressions that refer to downloaded data.
7063
However, automatically declaring components to be "safe for multi-versioning" carries some risk - even if a component is configured accordingly, it is not guaranteed that its provided Jsonnet libraries and/or its Jsonnet dependencies work if used across versions.
71-
Therefore, we deem it safer to let component authors decide if multi-versioning is safe to use for their component.
64+
Additionally, so far we've defined explicit flags for components to indicate that they support optional features, such as multiple instances.
65+
For all of those reasons, we've decided that component authors must explicitly declare whether multi-versioning is safe to use for their component.
7266

7367
=== Supporting different versions of Jsonnet dependencies per instance
7468

0 commit comments

Comments
 (0)