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

Che Theia clones projects every time a workspace is loaded/refreshed, even if the project was already cloned. #13796

Closed
johnmcollier opened this issue Jul 8, 2019 · 6 comments · Fixed by eclipse-che/che-theia#339
Assignees
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@johnmcollier
Copy link
Contributor

johnmcollier commented Jul 8, 2019

Possibly related to #13784

Description

I'm using Che 7 with eclipse/che-theia/7.0.0-rc-3.0 as the editor. I have a simple devfile defined with two projects (https://raw.githubusercontent.com/johnmcollier/devfiles/master/devfile_test.yaml). Every time I load the Che workspace, Theia clones the projects (or at least one of the projects), even if project already exists. Furthermore, even when I refresh the workspace in my browser, Theia reclones the projects.

Screen Shot 2019-07-08 at 12 12 02 PM

and then after reloading/refreshing:
Screen Shot 2019-07-08 at 12 12 16 PM

I've refreshed the workspace in my browser 5 times, so there's 5 nodeExpressTemplate projects cloned. This also happens if I open the workspace via Che.

Che/Theia should only be cloning on the first time Theia loads, rather than on every time.

@johnmcollier johnmcollier changed the title Che Theia clones projects every time a workspace is loaded Che Theia clones projects every time a workspace is loaded/refreshed. Jul 8, 2019
@johnmcollier johnmcollier changed the title Che Theia clones projects every time a workspace is loaded/refreshed. Che Theia clones projects every time a workspace is loaded/refreshed, even if the project was previous cloned. Jul 8, 2019
@johnmcollier johnmcollier changed the title Che Theia clones projects every time a workspace is loaded/refreshed, even if the project was previous cloned. Che Theia clones projects every time a workspace is loaded/refreshed, even if the project was already cloned. Jul 8, 2019
@sunix sunix added area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. labels Jul 8, 2019
@l0rd l0rd added this to the 7.0.0 milestone Jul 8, 2019
@l0rd l0rd added severity/P1 Has a major impact to usage or development of the system. team/ide labels Jul 8, 2019
@sunix
Copy link
Contributor

sunix commented Jul 8, 2019

normally it should check on the filesystem if the projects are here or not:
https://github.com/eclipse/che-theia/blob/master/plugins/factory-plugin/src/workspace-projects-manager.ts#L131

@johnmcollier could you quickly check from the terminal (because i don't trust the UI) if the projects are cloned in /projects ?

@johnmcollier
Copy link
Contributor Author

johnmcollier commented Jul 8, 2019

@sunix Yup, the projects are there (I also manually exec'd into the theia container to check as well):

johns-mbp-3:~ johncollier$ oc exec -it workspacehp48djlzatw1wakk.che-workspace-pod-8489c7d8dd-bzgbx -c theia-ideox7 bash
bash-4.4$ ls -al /projects/
total 32
drwxrwsr-x    8 root     2003          4096 Jul  8 17:15 .
drwxr-xr-x   24 root     root          4096 Jul  8 16:46 ..
drwxr-sr-x    5 theia    2003          4096 Jul  8 16:46 microproj
drwxr-sr-x    7 theia    2003          4096 Jul  8 16:46 nodeExpressTemplate
drwxr-sr-x    7 theia    2003          4096 Jul  8 16:46 nodeExpressTemplate-1
drwxr-sr-x    7 theia    2003          4096 Jul  8 17:15 nodeExpressTemplate-2
drwxr-sr-x    7 theia    2003          4096 Jul  8 17:15 nodeExpressTemplate-3
drwxr-sr-x    7 theia    2003          4096 Jul  8 17:16 nodeExpressTemplate-4
bash-4.4$ ls -al /projects/nodeExpressTemplate
total 40
drwxr-sr-x    7 theia    2003          4096 Jul  8 16:46 .
drwxrwsr-x    8 root     2003          4096 Jul  8 17:15 ..
-rw-r--r--    1 theia    2003            34 Jul  8 16:46 .dockerignore
drwxr-sr-x    8 theia    2003          4096 Jul  8 16:46 .git
-rw-r--r--    1 theia    2003           105 Jul  8 16:46 .gitignore
-rw-r--r--    1 theia    2003           425 Jul  8 16:46 Dockerfile
-rw-r--r--    1 theia    2003           490 Jul  8 16:46 Dockerfile-tools
-rw-r--r--    1 theia    2003            93 Jul  8 16:46 Jenkinsfile
-rw-r--r--    1 theia    2003           475 Jul  8 16:46 README.md
drwxr-sr-x    3 theia    2003          4096 Jul  8 16:46 chart
-rw-r--r--    1 theia    2003          2222 Jul  8 16:46 cli-config.yml
-rw-r--r--    1 theia    2003          2752 Jul  8 16:46 idt.js
-rw-r--r--    1 theia    2003           118 Jul  8 16:46 manifest.yml
-rw-r--r--    1 theia    2003            79 Jul  8 16:46 nodemon.json
-rw-r--r--    1 theia    2003          1479 Jul  8 16:46 package.json
drwxr-sr-x    2 theia    2003          4096 Jul  8 16:46 public
-rw-r--r--    1 theia    2003           471 Jul  8 16:46 run-debug
-rw-r--r--    1 theia    2003            77 Jul  8 16:46 run-dev
drwxr-sr-x    5 theia    2003          4096 Jul  8 16:46 server
drwxr-sr-x    2 theia    2003          4096 Jul  8 16:46 test

I should note that it never reclones the microproj project. Only nodeExpressTemplate for some reason.

@sunix
Copy link
Contributor

sunix commented Jul 8, 2019

ok thanks maybe this is not related to #13784 then. We are going to try to reproduce that in a unit test.

@sunix
Copy link
Contributor

sunix commented Jul 8, 2019

ok ... somehow i can see in your screenshot

Project https://github.com/microclimate-dev2ops/nodeExpressTemplate cloned to undefined and checked out default branch.

So destination path is somehow undefined ... a path to explore

@johnmcollier
Copy link
Contributor Author

johnmcollier commented Jul 8, 2019

@sunix I think have an idea of what's happening: In my devfile (https://raw.githubusercontent.com/johnmcollier/devfiles/master/devfile_test.yaml), I specify project names for the two git projects (microproj and nodeTemplate). But the latter (nodeTemplate) is different from the name of its git repo (nodeExpressTemplate).

In previous versions of Theia, the project would be checked out under the project name specified in the devfile, not whatever the project's repo name is. But now, it only clones under the git repo name. Similarly, Che only ever reclones projects where the repo name doesn't match the Che project name.

To test this, I created another devfile: https://raw.githubusercontent.com/johnmcollier/devfiles/master/devfile_theia_names.yaml. This time, the project names match the git repo names. And now Che doesn't try to reclone the projects.

So seems like something weird is going on in theia when the two names (Che project name, and git repo name) mismatch

@sunix
Copy link
Contributor

sunix commented Jul 9, 2019

OK thanks for giving all these details it helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
4 participants