Skip to content
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

Che plugin that extends a existing plugin #19125

Closed
sunix opened this issue Feb 22, 2021 · 7 comments
Closed

Che plugin that extends a existing plugin #19125

sunix opened this issue Feb 22, 2021 · 7 comments
Labels
area/plugin-registry kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@sunix
Copy link
Contributor

sunix commented Feb 22, 2021

Is your enhancement related to a problem? Please describe.

In many situation, a devfile should have the ability to use an existing plugin but with additional vscode extensions.
For instance:

  • The quarkus plugin could extend the Java11 plugin (adding vscode ext) or the Java15 plugin (if one day it exists)
  • The lombok plugin could extend any of the Java based, could be quarkus or Java11 or java8
  • the tekton plugin could extend the openshift plugin or the kubernetes plugin

Describe the solution you'd like

So let's say we have cool2k/vscode-lombok/latest that is defined with in the plugin registry with an attribute basePlugin

apiVersion: v2
publisher: cool2k
name: vscode-lombok
version: 1.0.2
type: VS Code extension
repository: 'https://github.com/GabrielBB/vscode-lombok.git'
spec:
  basePlugin: redhat/java/latest
  extensions:
    - 'https://open-vsx.org/api/cool2k/vscode-lombok/1.0.2/file/cool2k.vscode-lombok-1.0.2.vsix'

in The devfile we would have:

  - type: chePlugin
    id: cool2k/vscode-lombok/latest
    extends: 
      - redhat/java11/latest
      - redhat/quarkus/latest

or

  - type: chePlugin
    id: redhat/quarkus/latest
    extends: 
      - redhat/java11/latest

Describe alternatives you've considered

There are merge plugin capabilities but these are very limited as it would merge the plugins with the same base image. For the lombok example, it would be hard to use as we would need to define lombok plugin per version of Java

Additional context

N/A

@sunix sunix added the kind/enhancement A feature request - must adhere to the feature request template. label Feb 22, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Feb 22, 2021
@ericwill ericwill added area/plugin-registry and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Feb 22, 2021
@ericwill
Copy link
Contributor

It's a nice idea, but comes with some significant corner cases that need to be addressed:

  • what happens if the extending plugin needs it's own dependencies/sidecar container?
  • what happens if the extending plugin has version incompatibilities with the plugins in the "base" plugin?
  • what do we gain by introducing an inheritance system into the plugin registry?

@tsmaeder
Copy link
Contributor

what do we gain by introducing an inheritance system into the plugin registry?

we get from an mn problem (javaquarkus*lombok, etc.) to an m+n problem. In particular, the quarkus plugin could be formulated as an extension to the Java plugin which could be freely combined with the lombok plugin, for example.

Since we have dependencies between VS Code extensions already (we just ignore them at the moment, if I recall correctly), that problem needs solving anyway and is not an argument against the proposal.

I agree that the sidecar problem needs a solution. I've proposed a long time ago that we merge all extensions requiring the same sidecar image in the same container. We already merge plugins that do now specify a container into the Theia IDE container. Why not extend that to all images? It would also save runtime resources.
We could then interpret the "extends" clause to mean "needs to run in the same container". If both plugins require the same sidecar, we can merge the containers and all is well. If we can't it's a configuration error. Additionally, if a che plugin does not specify a container, but has an "extends" clause, it would be run in whatever container the extended plugin runs in.

@benoitf
Copy link
Contributor

benoitf commented Feb 23, 2021

just a FYI, but merging sidecar containers using the same image into a single one is possible by enabling a flag in devfile.yaml

@tsmaeder
Copy link
Contributor

tsmaeder commented Feb 23, 2021

@benoitf do we have documentation on this? Asking because until this moment, I was not aware that such a feature existed.

@benoitf
Copy link
Contributor

benoitf commented Feb 23, 2021

and related issue: #15373

@che-bot
Copy link
Contributor

che-bot commented Sep 2, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 2, 2021
@che-bot che-bot closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugin-registry kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants