-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat: Use post-start event to start VS Code #1566
Conversation
Skipping CI for Draft Pull Request. |
1 similar comment
d4ea77d
to
74a3c60
Compare
Codecov Report
@@ Coverage Diff @@
## main #1566 +/- ##
=======================================
Coverage 93.68% 93.68%
=======================================
Files 47 47
Lines 1457 1457
Branches 253 253
=======================================
Hits 1365 1365
Misses 92 92
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This comment was marked as duplicate.
This comment was marked as duplicate.
events: | ||
preStart: | ||
- init-container-command | ||
postStart: | ||
- init-che-code-command |
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.
The main idea is - initialization of the che-code on the post-start
event vs execution entrypoint as a command to avoid overriding the UDI entrypoint.
I've tested creation of a workspace for the VS Code editor without Dashboard usage and I can confirm that the UDI entrypoint is not overridden anymore if I use these changes for the description of the editor.
At the same time there is still a problem when I create a workspace from the dashboard. So - I guess:
- logic on the DWO side works correctly
- we still need some changes on the dashboard side
I guess resolving this issue should fix the problem on the dashboard side.
So, let's keep the PR still as a draft.
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.
I tested it using this sample, it contains the same changes for the editor description.
It works well after merging the corresponding changes on the dashboard side.
74a3c60
to
5cc07f0
Compare
5cc07f0
to
9763cd7
Compare
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.
Final editor's devfile.yaml doesn't contain postStart command: it could be checked in published PR's content in surge:
To fix it, need to change this logic: https://github.com/eclipse-che/che-plugin-registry/blob/main/tools/build/src/devfile/meta-yaml-to-devfile-yaml.ts#L170-L203
thank you very much, Valerii, for the reviewing my PR! At the moment I have to switch to another blocker issue, I'm going to come back soon to investigate that logic and provide the corresponding changes... |
9763cd7
to
19dad8a
Compare
1 similar comment
74b8114
to
3c86e5c
Compare
@svor The issue: eclipse-che/che#22071 |
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
@RomanNikitenko probably we need the same changes in downstream https://github.com/redhat-developer/devspaces/blob/devspaces-3-rhel-8/dependencies/che-plugin-registry/che-editors.yaml
/retest |
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
thank you for the prompt! |
3c86e5c
to
ebf56c6
Compare
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.
A workspace has started with che-code editor and current changes:
tested with:
oc apply -f dw.yaml
where dw.yaml is:
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
name: git-clone-sample-devworkspace
spec:
started: true
template:
projects:
- name: web-nodejs-sample
git:
remotes:
origin: "https://github.com/che-samples/web-nodejs-sample.git"
commands:
- id: say-hello
exec:
component: che-code-runtime-description
commandLine: echo "Hello from $(pwd)"
workingDir: ${PROJECT_SOURCE}/app
contributions:
- name: che-code
uri: https://gist.githubusercontent.com/svor/272c56c4aab0468a6079ac932d562a75/raw/6fa7505409e93cabf11e73d2c70478db6d43c07e/che-code2.yaml
components:
- name: che-code-runtime-description
container:
env:
- name: CODE_HOST
value: 0.0.0.0
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: RomanNikitenko, svor The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
depends on: #1613
What does this PR do?
Use post-start event instead of command to start VS Code
What issues does this PR fix or reference?
eclipse-che/che#21879
How to test this PR?
We should check that VS Code starts successfully after resolving devfile/devworkspace-operator#1029
I tested it like:
Create Workspace
pageGit Repo URL
Create & Open
buttonThe sample contains the corresponding changes for the editor description.
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.
Signed-off-by: Roman Nikitenko rnikiten@redhat.com