-
Notifications
You must be signed in to change notification settings - Fork 114
feat: add a devworkspace generator tool to replace editor's handlers and support container contribution #690
Conversation
Signed-off-by: Valerii Svydenko <[email protected]>
Signed-off-by: Valerii Svydenko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have tested the samples plus I have run a script like this one to spot differences among different objects and everything looks good 👍
I have just a couple of questions:
Since you are pushing on main branch shouldn't you call the devworkspace files devworkspace-che-theia-next.yaml
instead of devworkspace-che-theia-latest.yaml
? That would be also consistent with che-code-insiders
.
And why aren't we generating che-idea
based devworkspaces?
#!/bin/bash
set -e -u
SAMPLES=(apache-camel-k apache-camel-springboot bash cpp dotnet-asp.net go java-lombok java-mongo java-web-spring nodejs nodejs-angular nodejs-mongo nodejs-react nodejs-yarn php-symfony python quarkus rust scala-sbt)
for SAMPLE in "${SAMPLES[@]}"
do
IMAGE='vsvydenko/che-devfile-registry:contributions'
DWPATH="/usr/local/apache2/htdocs/devfiles/$SAMPLE/devworkspace-che-code-insiders.yaml"
DWPATH2="/usr/local/apache2/htdocs/devfiles/$SAMPLE/devworkspace-che-theia-latest.yaml"
docker run -ti --rm --entrypoint="cat" $IMAGE $DWPATH | split -a 1 -p '---' - /tmp/devworkspace
mv /tmp/devworkspacea /tmp/dwt
mv /tmp/devworkspaceb /tmp/dw
docker run -ti --rm --entrypoint="cat" $IMAGE $DWPATH2 | split -a 1 -p '---' - /tmp/devworkspace2
mv /tmp/devworkspace2a /tmp/dwt2
mv /tmp/devworkspace2b /tmp/dw2
# diff /tmp/dwt-orig /tmp/dwt || true
diff /tmp/dw /tmp/dw2 || true
# cat /tmp/dw | yq .spec.template.components > /tmp/dw-clean
# GIT_SAMPLE=`cat /tmp/dw | yq '.spec.template.projects[0].name'`
# DFURL="https://raw.githubusercontent.com/che-samples/$GIT_SAMPLE/devfilev2/devfile.yaml"
# echo "$DFURL"
# curl -fsSL $DFURL > /tmp/devfile
# cat /tmp/devfile | yq .components > /tmp/devfile-clean
# diff /tmp/devfile-clean /tmp/dw-clean || true
done
Signed-off-by: Valerii Svydenko <[email protected]>
@l0rd che-theia-next editor was removed from the editor's list: eclipse-che/che#21814
with my last commit devWorkspaces are generated with che-idea-next editor as well |
What does this PR do?
Adds devworkspace-generator tooling into che-devfile-registry to generate DevWorksapces that will be included into the resulted image and support container contribution feature. This generator tool replaces handlers from che-code and che-theia repositories.
For now it generates DevWorkspace with DevWorkspaceTemplate for each sample in the registry. Each sample will have two generated files (one with Theia editor and another one with VSCode editor). The content of the generated files looks like:
devworkspace-che-code-insiders.yaml
devworkspace-che-theia-latest.yaml
NOTE: One problem I've detected. Che-theia devworkspace-handler library analyzes .vscode/extesnions.json and .che/ce-theia-plugins.json files in the sample repository and adds all Theia plugins into the generated devworkspace, in this case all plugins will be installed in the workspace automatically. With this new generator tool plugins won't be added into the DevWorksapce with Theia editor.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
eclipse-che/che#21832
How to test this PR?
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.