feat: add support for inheriting properties from workspace groups#346
feat: add support for inheriting properties from workspace groups#346vytautas-astrauskas-sensmetry wants to merge 5 commits into
Conversation
a6a2b5c to
b9fc70b
Compare
Signed-off-by: Vytautas Astrauskas <vytautas.astrauskas@sensmetry.com>
b9fc70b to
b3b176f
Compare
|
I havn't heard discussion leading up to this about this feature, but is this worth the complexity and priority to add now and maintain long run? |
It is necessary for publishing the standard library, which soon will have to be updated regularly (likely almost every month). Also, I expect other users to use workspaces extensively and benefit from being able to declare things in a single place. |
|
Okay! Im squeezing in this review input from mobile, but these kinds of considerations are key to me:
UX prompt / response
I'll take a look at the PR to understand what config option we're talking about. Here's my read on what the PR is actually doing, then where I'd push the UX. What it does: a "group" is a named bundle of default properties that member projects inherit. The workspace declares The two things I'd change: 1. The per-field pointer is the weak point. Opting in by overwriting each field's value with { "extends": "kerml", "index": { "A": "a.sysml" }, ... }
2. Naming is inconsistent and misleading. It's defined as So the shape becomes: workspace defines Behavior to pin down explicitly (intuitive defaults in brackets): precedence between local and inherited values [local wins]; whether Want me to sketch the full before/after for both files, or dig into the multiple-inheritance edge cases?
Current design
{
"projects": [
{ "path": "project1", "iris": ["urn:kpar:project1"] }
],
"groups": {
"kerml": {
"project": { "version": "1.0.0" },
"meta": { "metamodel": "https://www.omg.org/spec/KerML/20250201" }
}
}
}
{
"metamodel": { "workspace": "kerml" }
}
{
"version": { "workspace": "kerml" }
}Proposed design
{
"projects": [
{ "path": "project1", "iris": ["urn:kpar:project1"] }
],
"presets": {
"kerml": {
"project": { "version": "1.0.0" },
"meta": { "metamodel": "https://www.omg.org/spec/KerML/20250201" }
}
}
}
{
"extends": "kerml",
"version": "1.2.0"
}
{
"extends": "kerml",
"index": { "A": "a.sysml" },
"checksum": { "a.sysml": { "value": "", "algorithm": "NONE" } }
}Net effect for Notable shiftsThe biggest change is that One open question this surfaces: "projects": [
{ "path": "project1", "iris": ["urn:kpar:project1"], "extends": "kerml" }
]Option (b) is cleaner (single source, the workspace already lists members) but means a project file alone no longer tells you what it inherits — you have to read the workspace. I'd lean (b) for the std-library case where the workspace is the control point, but (a) keeps projects self-describing. Which matters more to you? |
I will leave this for @andrius-puksta-sensmetry to answer since he has a more in-depth knowledge of Sysand. By the way, the workspaces are an experimental feature (meaning that they can have breaking changes in any release) exactly to be able for us to figure out such things by testing Sysand in realistic usage scenarios. |
The majority of users would take properties not from groups, but from the workspace directly in the same way as we do with Cargo. For example: {
"projects": [
{
"path": "project1",
"iris": ["urn:kpar:project1"]
}
],
"project": {
"version": "2.0.0"
}
}
{
"name": "project1",
"version": { "workspace": true },
"usage": []
}The groups are needed only to support the case where the same workspace contains both KerML and SysML projects, which is likely to be rare (that is my guess, but we need actual usage data). For this case where there are no groups and all properties are inherited directly, using explicit What are your thoughts? |
|
I suggest:
I considered suggesting putting the default preset under presets.default as well, but i figure its better to retain it at top level project/meta to avoid significant nesting for the most common situation. |
consideRatio
left a comment
There was a problem hiding this comment.
I havnt reviewed the code, but I also think we shouldn't allocate much time towards it now for this feature. I also dont want the lack of approval stop from merge when you think its fine to merge. 👍 On self evaluating when to merge this work!
Done.
Done.
Currently, the user needs to choose to define either in
Done. |
Signed-off-by: Vytautas Astrauskas <vytautas.astrauskas@sensmetry.com>
9321611 to
7a7f6fc
Compare
|
Proper implementation is blocked by #281. Freezing this PR until it is completed. |
We can't get stdlib on index before #281 and this PR thrn, right? Did we require the stdlib on the index? EDIT: Answer in meet, we don't need the official index, but our own, and this is only blocking the official. |
Adds
groupsto.workspace.json:{ "projects": [ { "path": "project1", "iris": ["urn:kpar:project1"] } ], "groups": { "kerml": { "project": { "version": "1.0.0" }, "meta": { "metamodel": "https://www.omg.org/spec/KerML/20250201" } } } }that enable inheriting the specified properties in
.project.jsonand.meta.jsonfiles:{ "index": { "A": "a.sysml" }, "created": "2025-10-31T17:01:00.414506000Z", "metamodel": { "workspace": "kerml" }, "checksum": { "a.sysml": { "value": "", "algorithm": "NONE" } } }