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

Add ability to defined any subfolders of a git project as workspace roots. #15347

Closed
sunix opened this issue Nov 27, 2019 · 7 comments
Closed
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system.

Comments

@sunix
Copy link
Contributor

sunix commented Nov 27, 2019

Is your enhancement related to a problem? Please describe.

By default, che workspaces have only 1 workspace root: /projects but Theia could accept multiple roots.

Edit: with #17212 each git-repo/project is turned into a workspace root. So what is missing is to have a way to define 1+ subfolders of a git repo as workspace root.

A workspace root is the top folders that the user would see in the explorer. Each folder is a kind of view of a folder in the file system. See https://code.visualstudio.com/docs/editor/multi-root-workspaces (quite same behaviour in VSCode)

Some extensions are relying on workspace roots to work well.
For instance, with the vscode openshift connector extension, having multiple components in a same workspace is requiring that each component source code folder to be a workspace root.

So the user would have to set a workspace root with the command Add folder to workspace for each component. there are some problems:

  • workspace roots defined are lost after restart.
  • user has to set workspace roots manually even if the devfile author knows in advanced which folder would be need to be workspace root

Describe the solution you'd like

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.

  - source:
      type: git
      location: 'https://github.com/sunix/che-quarkus-demo'
      branch: microservices
    roots: ['quarkus-backend', 'node-frontend']
    name: che-quarkus-demo

  - source:
      type: git
      location: 'https://github.com/sclorg/nodejs-ex'
    name: nodejs-ex

  - source:
      type: git
      location: 'https://github.com/sunix/nodejs-ex'
    roots: []
    name: nodejs-ex-sunix

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.

Alternative solution

By default, set each repo of the defile as workspace root. But we would still want to support workspace root on a sub folder of a git repo.

Additional context

This is one solution to fix #15273

@sunix sunix added the kind/enhancement A feature request - must adhere to the feature request template. label Nov 27, 2019
@benoitf benoitf added area/editor/theia Issues related to the che-theia IDE of Che area/devfile severity/P2 Has a minor but important impact to the usage or development of the system. labels Nov 27, 2019
@tolusha
Copy link
Contributor

tolusha commented Nov 28, 2019

It is relative to Go extension as well.

@azatsarynnyy
Copy link
Member

It is relative to K8s extension as well.

@sunix sunix changed the title User should be able to define workspace roots in a Devfile Workspace roots are not persisted. Workspace roots should be defined and persisted in a the devfile. Dec 9, 2019
@RomanNikitenko
Copy link
Member

Looks like it's related to #13080

@sunix
Copy link
Contributor Author

sunix commented Jan 2, 2020

@RomanNikitenko I have created a epic: #15529

@gattytto
Copy link

it is also related to bazel extension

@che-bot
Copy link
Contributor

che-bot commented Jan 20, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2021
@sunix sunix removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2021
@sunix sunix changed the title Workspace roots are not persisted. Workspace roots should be defined and persisted in a the devfile. Add the ability to persist (in the devfile) and override all workspace roots defined as subfolders of a repo. Mar 23, 2021
@sunix sunix changed the title Add the ability to persist (in the devfile) and override all workspace roots defined as subfolders of a repo. Add ability to defined any subfolders of a git project as workspace roots. Mar 23, 2021
@che-bot
Copy link
Contributor

che-bot commented Sep 20, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 20, 2021
@che-bot che-bot closed this as completed Oct 12, 2021
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/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

7 participants