Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Handle more exported properties from remote plugins #794

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

benoitf
Copy link
Contributor

@benoitf benoitf commented Jul 6, 2020

What does this PR do?

Handle more properties from the exports
also handle constants directly (as some plugin's are checking if the returned value is a string and not a function that might return a string)

Checked with https://che.openshift.io/f?url=https://gist.githubusercontent.com/benoitf/1fcff181b08448a96ee186bec3b5222f/raw/f4bbe2febfbd89a32dcfdf6eff470f674be7010c/devfile-16589.yaml

image

What issues does this PR fix or reference?

Part of eclipse-che/che#16589

Change-Id: Icbb026f65577422168f1acab486e598c6146c170
Signed-off-by: Florent Benoit [email protected]

@che-bot
Copy link
Contributor

che-bot commented Jul 6, 2020

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:794
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:794

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

Handle more properties from the exports
also handle constants directly (as some plugin's are checking if the returned value is a string and not a function that might return a string)

Change-Id: Icbb026f65577422168f1acab486e598c6146c170
Signed-off-by: Florent Benoit <[email protected]>
@che-bot
Copy link
Contributor

che-bot commented Jul 6, 2020

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:794
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:794

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 7, 2020

I think there is a problem here: I set up a debug environment according to https://github.com/eclipse/che-theia/blob/master/CONTRIBUTING.md#how-to-develop-che-theia-remote-plugin-mechanism

  1. I built the sonarlint plugin from source and added that to plugins folder of the remote plugin host
  2. Added a breakpoint in java.ts#installClasspathListener(...)
  3. The breakpoint was hit
  4. Stepped over the line containing VSCode.extensions.getExtension('redhat.java');
  5. Observe: the result is undefined

So the classpath listener is never installed.

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 7, 2020

FWIW: my devfile:

metadata:
  name: che-theia-remote-dev
projects:
  - name: theia
    source:
      location: 'https://github.com/eclipse-theia/theia'
      type: git
      branch: master
  - name: che-theia
    source:
      location: 'https://github.com/benoitf/che-theia'
      type: git
      branch: CHE-16589
    clonePath: theia/che/che-theia
components:
  - id: eclipse/che-theia/next
    type: cheEditor
    alias: theia-editor
  - id: che-incubator/typescript/latest
    memoryLimit: 2Gi
    type: chePlugin
  - mountSources: true
    endpoints:
      - name: theia-dev-flow
        port: 3010
        attributes:
          protocol: http
          public: 'true'
    memoryLimit: 3Gi
    type: dockerimage
    image: 'quay.io/eclipse/che-theia-dev:next'
    alias: theia-dev
    env:
      - value: '2504'
        name: THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT
  - mountSources: true
    memoryLimit: 1Gi
    type: dockerimage
    image: 'quay.io/eclipse/che-theia-dev:next'
    alias: remote-1
    env:
      - value: '2504'
        name: THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT
      - value: 'local-dir:///projects/plugins-1/'
        name: THEIA_PLUGINS
  - mountSources: true
    memoryLimit: 1Gi
    type: dockerimage
    image: 'quay.io/eclipse/che-theia-dev:next'
    alias: sonar-plugin
    env:
      - value: '2504'
        name: THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT
      - value: 'local-dir:///projects/plugins-sonar/'
        name: THEIA_PLUGINS
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/eclipse/che-plugin-registry/master/v3/plugins/redhat/java11/0.63.0/meta.yaml
    alias: java
  - type: chePlugin
    reference: >-
      https://raw.githubusercontent.com/eclipse/che-plugin-registry/master/v3/plugins/ms-vscode/node-debug2/1.42.3/meta.yaml
    alias: node-debug
apiVersion: 1.0.0

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 7, 2020

@benoitf what is your procedure for verifying that the sonarlint plugin works correctly with Java stuff?

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 7, 2020

Ok, I need to add the Java plugin to the target system...stand by.

@benoitf
Copy link
Contributor Author

benoitf commented Jul 7, 2020

in that specific case, I added explicit dependencies to redhat.java in extensionDependencies of package.json of sonarsource

without that patch, it fails to see all stuff from redhat.java

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 7, 2020

In the spirit of compatiblity with vs code extensions, I think we should not rely on the "extensionDependencies" field in the package.json for "getExtension(...)" to work. Also, since it works when running in the same container, I would argue that the extension API should be as much location transparent as possible.

@benoitf
Copy link
Contributor Author

benoitf commented Jul 7, 2020

I agree that we should make it work but at some point but there is a real need to have optional dependencies marked in package.json microsoft/vscode#6384

Because in activation events, it needs to be ordered

BTW this PR was just fixing wrong exported elements, not addressing the optional/required extensions issue

@benoitf benoitf merged commit 88a0fc1 into eclipse-che:master Jul 7, 2020
@benoitf benoitf deleted the CHE-16589 branch July 7, 2020 14:38
vinokurig pushed a commit that referenced this pull request Apr 6, 2021
* Update vale to "official" version 0.12.0

Signed-off-by: Thomas Mäder <[email protected]>

* Address PR comments

Signed-off-by: Thomas Mäder <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants