eclipse-che / che-theia

Eclipse Public License 2.0
125 stars 111 forks source link

chore(plugins-view): plugin list was not displayed for DevWorkspace instances #1225

Closed vitaliy-guliy closed 3 years ago

vitaliy-guliy commented 3 years ago

Signed-off-by: Vitaliy Gulyy vgulyy@redhat.com

What does this PR do?

Implements K8sWorkspaceServiceImpl.getWorkspaceSettings() method to be able Che-Theia get plugin registry internal/external URLs.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://github.com/eclipse/che/issues/20448

How to test this PR?

Devfile to create a workspace ``` schemaVersion: 2.1.0 attributes: che-editor.yaml: | schemaVersion: 2.1.0 metadata: name: theia-ide commands: - id: init-container-command apply: component: remote-runtime-injector events: preStart: - init-container-command components: - name: theia-ide container: image: 'quay.io/crw_pr/che-theia:1225' env: - name: THEIA_PLUGINS value: 'local-dir:///plugins' - name: HOSTED_PLUGIN_HOSTNAME value: 0.0.0.0 - name: HOSTED_PLUGIN_PORT value: '3130' - name: THEIA_HOST value: 0.0.0.0 volumeMounts: - name: plugins path: /plugins - name: theia-local path: /home/theia/.theia mountSources: true memoryLimit: 2500M cpuLimit: 1500m cpuRequest: 100m endpoints: - name: theia attributes: type: main cookiesAuthEnabled: true discoverable: false urlRewriteSupported: true targetPort: 3100 exposure: public secure: false protocol: https - name: webviews attributes: type: webview cookiesAuthEnabled: true discoverable: false unique: true urlRewriteSupported: true targetPort: 3100 exposure: public secure: false protocol: https - name: mini-browser attributes: type: mini-browser cookiesAuthEnabled: true discoverable: false unique: true urlRewriteSupported: true targetPort: 3100 exposure: public secure: false protocol: https - name: theia-dev attributes: type: ide-dev discoverable: false urlRewriteSupported: true targetPort: 3130 exposure: public protocol: http - name: theia-redirect-1 attributes: discoverable: false urlRewriteSupported: true targetPort: 13131 exposure: public protocol: http - name: theia-redirect-2 attributes: discoverable: false urlRewriteSupported: true targetPort: 13132 exposure: public protocol: http - name: theia-redirect-3 attributes: discoverable: false urlRewriteSupported: true targetPort: 13133 exposure: public protocol: http - name: terminal attributes: type: collocated-terminal discoverable: false cookiesAuthEnabled: true urlRewriteSupported: true targetPort: 3333 exposure: public secure: false protocol: wss attributes: app.kubernetes.io/component: che-theia app.kubernetes.io/part-of: che-theia.eclipse.org - name: plugins volume: {} - name: theia-local volume: {} - name: che-machine-exec container: image: 'quay.io/eclipse/che-machine-exec:next' command: - /go/bin/che-machine-exec - '--url' - '0.0.0.0:3333' memoryLimit: 128Mi memoryRequest: 32Mi cpuLimit: 500m cpuRequest: 30m attributes: app.kubernetes.io/component: machine-exec app.kubernetes.io/part-of: che-theia.eclipse.org - name: remote-runtime-injector container: image: 'quay.io/eclipse/che-theia-endpoint-runtime-binary:next' env: - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE value: /remote-endpoint/plugin-remote-endpoint - name: REMOTE_ENDPOINT_VOLUME_NAME value: remote-endpoint volumeMounts: - name: remote-endpoint path: /remote-endpoint memoryLimit: 128Mi memoryRequest: 32Mi cpuLimit: 500m cpuRequest: 30m attributes: app.kubernetes.io/component: remote-runtime-injector app.kubernetes.io/part-of: che-theia.eclipse.org - name: remote-endpoint volume: ephemeral: true metadata: name: nodejs-web-app-rbuz namespace: admin-che projects: - git: checkoutFrom: revision: devfilev2 remotes: origin: 'https://github.com/che-samples/web-nodejs-sample.git' name: web-nodejs-sample components: - attributes: app.kubernetes.io/name: nodejs che-theia.eclipse.org/vscode-extensions: - 'https://open-vsx.org/api/vscode/typescript-language-features/1.49.3/file/vscode.typescript-language-features-1.49.3.vsix' - 'https://open-vsx.org/api/ms-vscode/js-debug/1.52.2/file/ms-vscode.js-debug-1.52.2.vsix' container: args: - sh - '-c' - '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}' endpoints: - exposure: public name: nodejs protocol: http targetPort: 3000 env: - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE value: /remote-endpoint/plugin-remote-endpoint - name: THEIA_PLUGINS value: 'local-dir:///plugins/sidecars/nodejs' image: 'quay.io/devfile/universal-developer-image:ubi8-b452131' memoryLimit: 1G mountSources: true sourceMapping: /projects volumeMounts: - name: remote-endpoint path: /remote-endpoint - name: plugins path: /plugins name: nodejs commands: - exec: commandLine: npm install component: nodejs group: isDefault: true kind: build label: Download dependencies workingDir: '${PROJECTS_ROOT}/web-nodejs-sample/app' id: dependencies - exec: commandLine: nodemon app.js component: nodejs group: kind: run label: Run the web app workingDir: '${PROJECTS_ROOT}/web-nodejs-sample/app' id: runapp - exec: commandLine: nodemon --inspect app.js component: nodejs group: isDefault: true kind: debug label: Run the web app (debugging enabled) workingDir: '${PROJECTS_ROOT}/web-nodejs-sample/app' id: debug - exec: commandLine: 'node_server_pids=$(pgrep -fx ''.*nodemon (--inspect )?app.js'' | tr "\\n" " ") && echo "Stopping node server with PIDs: ${node_server_pids}" && kill -15 ${node_server_pids} &>/dev/null && echo ''Done.''' component: nodejs group: kind: run label: Stop the web app id: stopapp ```

To create a workspace use this public Gist https://gist.githubusercontent.com/vitaliy-guliy/c3eadb47d3c241d9a6632029e580bf91/raw/802bab8a45fd388c3e91a26cc98a1f083adaf2dc

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Happy Path Channel

HAPPY_PATH_CHANNEL=stable

che-bot commented 3 years ago

:white_check_mark: E2E Happy path tests succeed :tada:

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

See Details

- [Jenkins job](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/blue/organizations/jenkins/Che%2Fe2e%2Fminikube%2Fpr-check%2Fche-theia-pr-check/detail/che-theia-pr-check/522) - [test report](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/522/artifact/che/tests/e2e/report/) - [logs and configs](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/522/artifact/logs-and-configs/) - [Happy path tests DevFile](https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che-theia/pr-1225/happy-path-workspace.yaml) - images: | name | link| |---|---| | che-theia | quay.io/crw_pr/che-theia:1225| | che-theia-endpoint-runtime-binary | quay.io/crw_pr/che-theia-endpoint-runtime-binary:1225| **Test product**: - tested with Eclipse Che on K8S (minikube v1.22.0) - [E2E test scenario](https://github.com/eclipse/che/blob/main/tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts) - [E2E test pipeline source code](https://gitlab.cee.redhat.com/codeready-workspaces/crw-jenkins/-/blob/master/jobs/Che/e2e/minikube/pr-check/che-theia-pr-check.jenkinsfile)

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

codecov[bot] commented 3 years ago

Codecov Report

Merging #1225 (d5e5622) into main (c299f59) will decrease coverage by 0.46%. The diff coverage is 22.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1225      +/-   ##
==========================================
- Coverage   32.78%   32.31%   -0.47%     
==========================================
  Files         290      296       +6     
  Lines        9885     9849      -36     
  Branches     1457     1322     -135     
==========================================
- Hits         3241     3183      -58     
- Misses       6641     6662      +21     
- Partials        3        4       +1     
Impacted Files Coverage Δ
...theia-about/src/browser/about-che-theia-dialog.tsx 0.00% <0.00%> (ø)
...credentials/src/browser/che-credentials-service.ts 0.00% <0.00%> (ø)
...entials/src/browser/credentials-frontend-module.ts 0.00% <0.00%> (ø)
...eia-credentials/src/common/credentials-protocol.ts 0.00% <0.00%> (ø)
...eia-credentials/src/node/che-credentials-server.ts 0.00% <0.00%> (ø)
...s/src/node/che-theia-credentials-backend-module.ts 0.00% <0.00%> (ø)
...rowser/src/browser/che-mini-browser-environment.ts 0.00% <0.00%> (ø)
...ia-plugin-remote/src/node/hosted-plugin-service.ts 0.00% <0.00%> (ø)
...in-remote/src/node/plugin-remote-backend-module.ts 0.00% <0.00%> (ø)
...theia-plugin-remote/src/node/plugin-remote-init.ts 0.00% <0.00%> (ø)
... and 208 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a2e6988...d5e5622. Read the comment docs.

che-bot commented 3 years ago

:x: E2E Happy path tests failed :heavy_exclamation_mark:

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

See Details

- [Jenkins job](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/blue/organizations/jenkins/Che%2Fe2e%2Fminikube%2Fpr-check%2Fche-theia-pr-check/detail/che-theia-pr-check/529) - [test report](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/529/artifact/che/tests/e2e/report/) - [logs and configs](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/529/artifact/logs-and-configs/) - [Happy path tests DevFile](https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che-theia/pr-1225/happy-path-workspace.yaml) - images: | name | link| |---|---| | che-theia | quay.io/crw_pr/che-theia:1225| | che-theia-endpoint-runtime-binary | quay.io/crw_pr/che-theia-endpoint-runtime-binary:1225| **Test product**: - tested with Eclipse Che on K8S (minikube v1.22.0) - [E2E test scenario](https://github.com/eclipse/che/blob/main/tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts) - [E2E test pipeline source code](https://gitlab.cee.redhat.com/codeready-workspaces/crw-jenkins/-/blob/master/jobs/Che/e2e/minikube/pr-check/che-theia-pr-check.jenkinsfile)

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

che-bot commented 3 years ago

:x: E2E Happy path tests failed :heavy_exclamation_mark:

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

See Details

- [Jenkins job](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/blue/organizations/jenkins/Che%2Fe2e%2Fminikube%2Fpr-check%2Fche-theia-pr-check/detail/che-theia-pr-check/532) - [test report](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/532/artifact/che/tests/e2e/report/) - [logs and configs](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/532/artifact/logs-and-configs/) - [Happy path tests DevFile](https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che-theia/pr-1225/happy-path-workspace.yaml) - images: | name | link| |---|---| | che-theia | quay.io/crw_pr/che-theia:1225| | che-theia-endpoint-runtime-binary | quay.io/crw_pr/che-theia-endpoint-runtime-binary:1225| **Test product**: - tested with Eclipse Che on K8S (minikube v1.22.0) - [E2E test scenario](https://github.com/eclipse/che/blob/main/tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts) - [E2E test pipeline source code](https://gitlab.cee.redhat.com/codeready-workspaces/crw-jenkins/-/blob/master/jobs/Che/e2e/minikube/pr-check/che-theia-pr-check.jenkinsfile)

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

vitaliy-guliy commented 3 years ago

The plugin list is displayed, but it's not possible to install any plugin due to different format and architecture between devfile V1 and devfile V2. Screenshot from 2021-10-12 17-10-58

che-bot commented 3 years ago

:x: E2E Happy path tests failed :heavy_exclamation_mark:

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

See Details

- [Jenkins job](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/blue/organizations/jenkins/Che%2Fe2e%2Fminikube%2Fpr-check%2Fche-theia-pr-check/detail/che-theia-pr-check/533) - [test report](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/533/artifact/che/tests/e2e/report/) - [logs and configs](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/533/artifact/logs-and-configs/) - [Happy path tests DevFile](https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che-theia/pr-1225/happy-path-workspace.yaml) - images: | name | link| |---|---| | che-theia | quay.io/crw_pr/che-theia:1225| | che-theia-endpoint-runtime-binary | quay.io/crw_pr/che-theia-endpoint-runtime-binary:1225| **Test product**: - tested with Eclipse Che on K8S (minikube v1.22.0) - [E2E test scenario](https://github.com/eclipse/che/blob/main/tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts) - [E2E test pipeline source code](https://gitlab.cee.redhat.com/codeready-workspaces/crw-jenkins/-/blob/master/jobs/Che/e2e/minikube/pr-check/che-theia-pr-check.jenkinsfile)

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

che-bot commented 3 years ago

:x: E2E Happy path tests failed :heavy_exclamation_mark:

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

See Details

- [Jenkins job](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/blue/organizations/jenkins/Che%2Fe2e%2Fminikube%2Fpr-check%2Fche-theia-pr-check/detail/che-theia-pr-check/537) - [test report](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/537/artifact/che/tests/e2e/report/) - [logs and configs](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/537/artifact/logs-and-configs/) - [Happy path tests DevFile](https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che-theia/pr-1225/happy-path-workspace.yaml) - images: | name | link| |---|---| | che-theia | quay.io/crw_pr/che-theia:1225| | che-theia-endpoint-runtime-binary | quay.io/crw_pr/che-theia-endpoint-runtime-binary:1225| **Test product**: - tested with Eclipse Che on K8S (minikube v1.22.0) - [E2E test scenario](https://github.com/eclipse/che/blob/main/tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts) - [E2E test pipeline source code](https://gitlab.cee.redhat.com/codeready-workspaces/crw-jenkins/-/blob/master/jobs/Che/e2e/minikube/pr-check/che-theia-pr-check.jenkinsfile)

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

che-bot commented 3 years ago

:white_check_mark: E2E Happy path tests succeed :tada:

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

See Details

- [Jenkins job](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/blue/organizations/jenkins/Che%2Fe2e%2Fminikube%2Fpr-check%2Fche-theia-pr-check/detail/che-theia-pr-check/538) - [test report](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/538/artifact/che/tests/e2e/report/) - [logs and configs](https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/Che/job/e2e/job/minikube/job/pr-check/job/che-theia-pr-check/538/artifact/logs-and-configs/) - [Happy path tests DevFile](https://raw.githubusercontent.com/chepullreq4/pr-check-files/master/che-theia/pr-1225/happy-path-workspace.yaml) - images: | name | link| |---|---| | che-theia | quay.io/crw_pr/che-theia:1225| | che-theia-endpoint-runtime-binary | quay.io/crw_pr/che-theia-endpoint-runtime-binary:1225| **Test product**: - tested with Eclipse Che on K8S (minikube v1.22.0) - [E2E test scenario](https://github.com/eclipse/che/blob/main/tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts) - [E2E test pipeline source code](https://gitlab.cee.redhat.com/codeready-workspaces/crw-jenkins/-/blob/master/jobs/Che/e2e/minikube/pr-check/che-theia-pr-check.jenkinsfile)

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe