Description
Is your feature request related to a problem? Please describe.
At the moment, the devfile declares projects
that are usually git projects. These git projects are actually git repository. In these git repos, it happens that projects to be loaded in an IDE are actually located in subfolders of the git repo.
For instance: https://github.com/redhat-developer-demos/quarkus-reactjs-postit-app should have node-frontend
and quarkus-backend
loaded as Project
(Eclipse IDE terminology) or Workspace root
(VSCode/Theia/Che terminology).
These projects
or roots
should be concidered and defined in the devfile.
Describe the solution you'd like
From eclipse-che/che#15347 (adapted to devfile 2)
Each projects defined in a workspace, would possibly have a list of folder that would be workspace roots of the Che workspace. /projects
is the default one.
projects:
- name: che-quarkus-demo
git:
location: 'https://github.com/sunix/che-quarkus-demo'
branch: microservices
roots: ['quarkus-backend', 'node-frontend']
- name: nodejs-ex
git:
location: 'https://github.com/sclorg/nodejs-ex'
- name: nodejs-ex-sunix
git:
location: 'https://github.com/sunix/nodejs-ex'
roots: []
would add the 3 folders /projects/nodejs-ex
, /projects/che-quarkus-demo/quarkus-backend
, /projects/che-quarkus-demo/node-frontend
as workspace root.
Of course if the user is using the command Add folder to workspace
, the devfile of the workspace would need to be updated.
/projects/nodejs-ex-sunix
is not added as a workspace root because of it has roots
array empty.
/projects/nodejs-ex
is added as a workspace root because it is the default behaviour if no roots
element is defined.
- name: nodejs-ex
git:
location: 'https://github.com/sclorg/nodejs-ex'
would be similar to
- name: nodejs-ex
git:
location: 'https://github.com/sclorg/nodejs-ex'
roots: ['.']
Describe alternatives you've considered
Using sparseCheckoutDirs, but user may want to keep the whole. sparseCheckoutDirs is useful for examples/samples repositories.
Additional context
Add any other context or screenshots about the feature request here.