You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,17 +24,13 @@ Commodore does not currently support specifying different component versions for
24
24
25
25
* Define how different versions for each component instance can be specified and generated.
26
26
27
-
=== Non-Goals
28
-
29
-
30
-
31
27
== Design Proposal
32
28
33
29
Commodore will leverage the existing configuration options in `.parameters.components` to retrieve version information for specific instances.
34
30
Instance versions can be specified in `.parameters.components.<instance-name>` and override the value specified in `.parameters.components.<component-name>`.
35
31
Even if all instances provide their own version, a version for the base component (`.parameters.components.<component-name>`) must still be specified.
36
32
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`.
38
34
In a valid catalog, all used versions of the same component must advertise this support.
39
35
40
36
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
51
47
We can clone the repository of the base component and create a separate worktree for each instance to check out the correct version.
52
48
53
49
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.
57
51
58
52
=== Risks and Drawbacks
59
53
60
54
* 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.
61
55
** Even if a component's dependencies are sufficiently backwards-compatible at the moment, it's possible for future changes to break compatibility.
62
56
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.
64
57
65
58
== Alternatives
66
59
67
60
=== Automatically detecting multi-version support
68
61
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.
70
63
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.
72
66
73
67
=== Supporting different versions of Jsonnet dependencies per instance
0 commit comments