Skip to content
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

fix: projects are ignored when restarting workspace from local devfile #345

Merged
merged 13 commits into from
May 14, 2024

Conversation

vitaliy-guliy
Copy link
Contributor

@vitaliy-guliy vitaliy-guliy commented Apr 15, 2024

What does this PR do?

  • fixes disappearing the projects after updating the devfile
  • proposes the user to select the devfile if workspace contains several projects
  • decouples updating the devfile in a separate try {} catch {} section to better understanding the cause of the error when restarting the workpace

Screenshot from 2024-05-14 09-44-35

Screenshot from 2024-05-14 09-44-45

What issues does this PR fix?

eclipse-che/che#22722

How to test this PR?

  1. Create a workspace with factory https://github.com/che-samples/java-spring-petclinic.git?che-editor=https://gist.githubusercontent.com/vitaliy-guliy/a2efd2a2e0f3324e057edab0ed7b2494/raw/05bac72e7318fc1edfe1e72e4e4dcabaa50a0ff3/editor.yaml&new

or just click at

Contribute

  1. Open the devfile in java-spring-petclinic project, add following section and save
projects:
  - name: nodejs-devfile-test
    git:
      remotes:
        origin: https://github.com/vitaliy-guliy/nodejs-devfile-test.git

  - name: lombok-project-sample
    git:
      remotes:
        origin: https://github.com/vitaliy-guliy/lombok-project-sample.git
  1. Run Eclipse Che: Restart Workspace from Local Devfile command, select a devfile for java-spring-petclinic project and confirm restart.

Workspace should be restarted, explorer should contain three projects.

  1. Install redhat.vscode-yaml extension.

  2. Open the devfile in java-spring-petclinic project, add some environment variable to the tools container.

      env:
        - name: test
          value: test_value
  1. Run Eclipse Che: Restart Workspace from Local Devfile command.

Select the devfile for java-spring-petclinic project and confirm restart to continue.
Once workspace is restarted, open the terminal and verify the environment variable is set.

  1. Copy the devfile in java-spring-petclinic project to the new file with a different name.
    Open newly created devfile, add another one environment variable like above and run Eclipse Che: Restart Workspace from Local Devfile command.
    In a proposed popup select the last item and then using the popup open the created devfile.
    Confirm restart when requested.

The workspace should be restarted. Open a terminal and check for environment variable.

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Copy link

github-actions bot commented Apr 15, 2024

Click here to review and test in web IDE: Contribute

Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
@vitaliy-guliy vitaliy-guliy marked this pull request as ready for review April 22, 2024 13:53
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

@RomanNikitenko
Copy link
Contributor

@vitaliy-guliy
I've tested the changes:

  • adding a project to the projects section works well for me
  • removing a project doesn't work

But, to be honest, I don't know how we should handle such cases...

@RomanNikitenko
Copy link
Contributor

RomanNikitenko commented Apr 23, 2024

About eclipse-che/che#22913
Actually, I don't see that the behaviour was changed, I see the following message:

image

Dashboard handles similar problem by providing the following message:

image

@vitaliy-guliy
Copy link
Contributor Author

  • removing a project doesn't work

But, to be honest, I don't know how we should handle such cases...

It is not clear what should we do if a user remove the project. That's why this behavior was omitted.

Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented May 6, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

github-actions bot commented May 6, 2024

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

Signed-off-by: vitaliy-guliy <[email protected]>
@vitaliy-guliy vitaliy-guliy marked this pull request as draft May 6, 2024 22:46
Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

github-actions bot commented May 7, 2024

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

@vitaliy-guliy vitaliy-guliy marked this pull request as ready for review May 7, 2024 13:55
Copy link

github-actions bot commented May 7, 2024

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

@vitaliy-guliy vitaliy-guliy changed the title [WIP] fix: projects are ignored when restarting workspace from local devfile fix: projects are ignored when restarting workspace from local devfile May 7, 2024
Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

@vitaliy-guliy vitaliy-guliy added the made-with-che Changes made with Che-Code label May 13, 2024
Signed-off-by: vitaliy-guliy <[email protected]>
Copy link

Pull Request Dev image published:
👉 quay.io/che-incubator-pull-requests/che-code-dev:pr-345-dev-amd64

Copy link

Pull Request Che-Code image published:
👉 quay.io/che-incubator-pull-requests/che-code:pr-345-amd64

@vitaliy-guliy vitaliy-guliy merged commit a67cd09 into main May 14, 2024
7 checks passed
@vitaliy-guliy vitaliy-guliy deleted the restart-from-local-devfile branch May 14, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
made-with-che Changes made with Che-Code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants