-
Notifications
You must be signed in to change notification settings - Fork 63
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
Polymorphic component type UX in a devfile #4
Comments
I prefer the alternative proposal. Having each type (containers, kubernetes, etc) under component be an array of elements (of length 0, 1, or many), makes things easier to read / understand in my opinion |
I was thinking of it a little bit different from the alt version. Current
Alternative 2
Alt 2 provides a more extensible model. If we use the current proposed schema, then any change would need to be done in Go code. However, I can see how this may take more work to validate. I do not think the language should drive the data structure but it can inform how it is made. |
@joshuawilson this looks redundant: components:
- component:
type: ... I would rather have the component spec directly without prefixing it with components:
- type: ... And that corresponds to the devfile 1.0.0 format (and if there is an agreement that this is the best alternative I am perfectly fine with it). |
@joshuawilson afaict, the following alt2 syntax proposal ...
... seems to move the problem encountered with the old Devfile 1.0.0 syntax, to a lower level (under the intermediate You may have distinct sub-schemas (according to the OTOH, the whole idea of
Some pointers about the context that drove this initial design;
|
I assume this adds a constraint on the order in which components have to be described, since they would be gathered by type ? |
I am not sure if it is a concern of the current effort for Devfile 2.0 but IMHO the "clustering" by component type, reflected in the schema, makes it kinda hard for the devfile spec to be interoperable, e.g. reused by other "processors" than Che/ODO without the need to add explicit support for them in the source code. E.g. in my dreamt up world, I would like to support multiple IDEs with a single devfile, maybe using something like this: components:
- type: chePlugin
id: redhat/java/latest
- type: eclipseDesktopPlugin
id: org.eclipse.jdt
- type: gitpodFeature
id: java-support
... Is that something we want to address in any way or is it out of scope? Or, given the majority of examples above, are we maybe considering externalizing the IDE configuration into some other part of the devfile than components - something in support of #5? |
@metlos In your example: components:
- type: chePlugin
id: redhat/java/latest
- type: eclipseDesktopPlugin
id: org.eclipse.jdt
- type: gitpodFeature
id: java-support the 3 components are in fact structurally equivalent, have the same sub-schema, and thus to me they seem to be the same type of component. The fact that they would define different types of plugin would probably fit into the encapsulated plugin definition itself (currently the So it seems to me that, while discussing this matter, we should avoid mixing component type, which drives distinct component sub-schemas, and what a plugin type field could be, i.e. a way to provide more insight about how a given plugin should be installed / used. |
@metlos that's an interesting scenario and I think we should take it in consideration. Your sample with the current proposal would look like: components:
- chePlugin:
id: redhat/java/latest
- eclipseDesktopPlugin:
id: org.eclipse.jdt
- gitpodFeature:
id: java-support
... or, if I am interpreting @davidfestal answer correctly: components:
- plugin:
id: redhat/java/latest
- plugin:
id: desktopEclipse/org.eclipse.jdt
- plugin:
id: gitpodFeature/java-support
... What's wrong with those? |
What I didn't take into consideration and what we discussed with @davidfestal before he posted his answer here was that the distinction between the different plugin types (e.g. theia/eclipse/gitpod/codewind/...) can happen in |
Discussed and agreed to go with "Current proposal" |
Implemented |
Polymorphic types makes
devWorkspaces
objects easier to validate and more close as a Kubernetes custom resources. But are we sacrificing the UX of the devfile? Was the 1.0.0 devfile spec easier to read and modify for humans?devfile 1.0.0
current proposal
alternative proposal
The text was updated successfully, but these errors were encountered: