Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Multi-root by default for Dev Workspaces #1043

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

RomanNikitenko
Copy link
Member

@RomanNikitenko RomanNikitenko commented Mar 22, 2021

Signed-off-by: Roman Nikitenko rnikiten@redhat.com

What does this PR do?

Enable multi-root by default for Dev Workspaces

Screenshot/screencast of this PR

What issues does this PR fix or reference?

eclipse-che/che#19191

How to test this PR?

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Happy Path Channel

HAPPY_PATH_CHANNEL=stable

@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #1043 (390c5aa) into master (d690740) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1043   +/-   ##
=======================================
  Coverage   21.46%   21.46%           
=======================================
  Files         315      315           
  Lines       11495    11495           
  Branches     1710     1710           
=======================================
  Hits         2467     2467           
  Misses       8882     8882           
  Partials      146      146           
Impacted Files Coverage Δ
...e-theia-workspace/src/node/che-workspace-server.ts 0.00% <0.00%> (ø)
...workspace-plugin/src/workspace-projects-manager.ts 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d690740...390c5aa. Read the comment docs.

@@ -56,6 +56,11 @@ export class CheWorkspaceServer extends DefaultWorkspaceServer {
}

function isMultiRoot(workspace: Workspace): boolean {
const devfile = workspace.devfile;
return !!devfile && !!devfile.attributes && !!devfile.attributes.multiRoot && devfile.attributes.multiRoot === 'on';
const devWorkspaceNamespace = process.env.DEVWORKSPACE_NAMESPACE;
Copy link
Contributor

@benoitf benoitf Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we created abstraction on how workspaces are retrieved (no process.env in the code except in remote-api-services)

so if you need to know, probably you can add a method in the api

another hint is to check if you've runtime in workspace object (undefined in the case of DevWorkspace)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else, we could always provide the attribute multiRoot in case of DevFile v2 implementation (so we don't change the consumer code)

Copy link
Member Author

@RomanNikitenko RomanNikitenko Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Florent, for the ideas how to handle this problem.

AFAIK we are going to turn on multi-root by default very soon.
We will consider that - the multi-root is ON for all cases except the case when there is the attribute multiRoot with off value.

So, the check will be like:

function isMultiRoot(workspace: Workspace): boolean {
  return workspace.devfile?.attributes?.multiRoot !== 'off';
}

Taking into account the info above I think we should apply a solution from your first comment, so:

  • adding a method to the API
    or
  • check if you've runtime in workspace object (undefined in the case of DevWorkspace)

If I didn't missed something - I guess the second one (runtime in workspace object) - is the simplest way.

@benoitf @azatsarynnyy
WDYT?

Copy link
Contributor

@benoitf benoitf Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes go to the simplest (2nd case as it's temporary)

@che-bot
Copy link
Contributor

che-bot commented Mar 22, 2021

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:1043
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:1043

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@RomanNikitenko RomanNikitenko force-pushed the defaultMultiRootForDevWorkspace branch from 6314f24 to 390c5aa Compare March 22, 2021 18:57
@che-bot
Copy link
Contributor

che-bot commented Mar 22, 2021

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:1043
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:1043

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@RomanNikitenko RomanNikitenko merged commit 28ffb30 into master Mar 23, 2021
@RomanNikitenko RomanNikitenko deleted the defaultMultiRootForDevWorkspace branch March 23, 2021 08:59
@che-bot che-bot added this to the 7.28 milestone Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants