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

Fix webview after changes in upstream. #563

Merged
merged 1 commit into from
Nov 27, 2019
Merged

Fix webview after changes in upstream. #563

merged 1 commit into from
Nov 27, 2019

Conversation

mmorhun
Copy link
Contributor

@mmorhun mmorhun commented Nov 26, 2019

Co-authored-by: Oleksandr Andriienko [email protected]
Signed-off-by: Mykola Morhun [email protected]

What does this PR do?

Fixes webview after changes in upstream Eclipse Theia.

According to changes in upstream Eclipse Theia, each webview is run on its own domain by default. In this PR we reconfigure Theia to run all webviews on the same as Che Theia host (actually as it was before).
Also after upstream changes it is possible to run webviews only with secure connection (requires https protocol), the only exception is localhost for testing purposes.

What issues does this PR fix or reference?

eclipse-che/che#15283

Co-authored-by: Oleksandr Andriienko <[email protected]>
Signed-off-by: Mykola Morhun <[email protected]>
@@ -76,7 +76,8 @@ if [ "${NOCDN}" == "true" ]; then
fi
shopt -u nocasematch

# run che
# run Che Theia
export THEIA_WEBVIEW_EXTERNAL_ENDPOINT=$(node get-webview-route.js)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: we don't have the endpoint as environment variable ?

Copy link
Contributor

@benoitf benoitf Nov 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, che-server is not providing that information to containers through env vars ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't have external route in env vars.

**********************************************************************/

const fs = require('fs');
const workspaceClient = require('@eclipse-che/workspace-client');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does it find this dependency ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets the dependency from Che Theia node modules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the dockerfile we copy script to the /home/theia, where is located node_modules

@@ -163,5 +163,6 @@ COPY --from=builder /home/theia-dev/theia-source-code/production/plugins /defaul
COPY --chown=theia:root --from=builder /home/theia-dev/theia-source-code/production /home/theia
USER theia
WORKDIR /projects
COPY src/get-webview-route.js ${HOME}/get-webview-route.js
Copy link
Contributor

@benoitf benoitf Nov 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be possible (maybe later) to use a runtime information instead of using environment variable.

Explanation: Here we're using a shell script before running the theia process in the container (by setting environment variable)

I think it would be cleaner if we bring a hook/extension point of theia at runtime by updating the setting on the fly. So no need to use separate script and fix env variable. It's when theia webview will resolve stuff that it will deal with che-theia code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we can do it in runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should try, but as for now I would like to merge current PR as it is tested and fixes (for https case) blocker issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is why I said later

@che-bot
Copy link
Contributor

che-bot commented Nov 26, 2019

❌ 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:563
che-remote-plugin-node docker.io/maxura/che-remote-plugin-node:563
che-remote-plugin-runner-java8 docker.io/maxura/che-remote-plugin-runner-java8:563
che-remote-plugin-kubernetes-tooling-1.0.0 docker.io/maxura/che-remote-plugin-kubernetes-tooling-1.0.0:563

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

⚠️ https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

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

@benoitf
Copy link
Contributor

benoitf commented Nov 26, 2019

image

Here is the image of welcome plug-in (so there is not only icon issue on my side)

@AndrienkoAleksandr
Copy link
Contributor

Here is the image of welcome plug-in (so there is not only icon issue on my side)

Known issue eclipse-che/che#15324

@benoitf
Copy link
Contributor

benoitf commented Nov 26, 2019

@AndrienkoAleksandr I know about the icon as I said, my question was more on the font colors/style:

Before:
image

@AndrienkoAleksandr
Copy link
Contributor

@benoitf my question was more on the font colors/style

Yes, Ok, I will take a look what was changed. But from first look welcome plugin used some styles from theia, and am not sure that they are accessible after web-view rework.

@benoitf
Copy link
Contributor

benoitf commented Nov 27, 2019

@AndrienkoAleksandr sure, we can't get exact same stuff than before.
Just need to check new rendering if @slemeur still like it

@AndrienkoAleksandr
Copy link
Contributor

sure, we can't get exact same stuff than before.

Ok, If @slemeur is ok with current rendering I will close this one eclipse-che/che#15334

@mmorhun mmorhun merged commit 2170465 into master Nov 27, 2019
@mmorhun mmorhun deleted the CHE-15283-1 branch November 27, 2019 08:12
vinokurig pushed a commit that referenced this pull request Apr 6, 2021
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.

5 participants