-
Notifications
You must be signed in to change notification settings - Fork 111
Add backward compatibility related to switching to multi root mode #1074
Add backward compatibility related to switching to multi root mode #1074
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1074 +/- ##
==========================================
+ Coverage 29.45% 31.34% +1.88%
==========================================
Files 277 277
Lines 9336 9364 +28
Branches 1380 1392 +12
==========================================
+ Hits 2750 2935 +185
+ Misses 6487 6332 -155
+ Partials 99 97 -2
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it, but code looks good.
@@ -103,6 +108,15 @@ export class WorkspaceProjectsManager { | |||
onDidCloneSourcesEmitter.fire(); | |||
} | |||
|
|||
// back compatibility for single-root workspaces | |||
// we need it to support workspaces wich were created before switching multi-root mode to ON by default | |||
protected ensureWorkspaceFoldersFor(projects: che.devfile.DevfileProject[]): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method is misnamed: as I read the code, it filters out projects that do not exist. If I read ensureWorkspaceFolders
, I would expect the missing folders to be created. Maybe just inline this method: it's only a single statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, will update my PR soon!
@@ -13,7 +13,7 @@ export class WorkspaceFolderUpdater { | |||
private pendingFolders: string[] = []; | |||
private addingWorkspaceFolderPromise: Promise<void> | undefined; | |||
|
|||
constructor(protected readonly updateWorkspaceFolderTimeout = 3000) {} | |||
constructor(protected readonly updateWorkspaceFolderTimeout = 10000) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels strange that we need 10 seconds here. Do we know where the time goes? Maybe something to investigate some time later. But +1 on the longer timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within testing my PR on the dogfooding
instance I found that sometimes 3 seconds is not enough.
I guess that 5 seconds - is good value for the dogfooding
instance, but I'm not sure it will be OK for another instance, for example for minikube
that running locally on a user machine with low resources.
So, I can reduce that value to 5-7 seconds within current PR and we could see if there is reported issues about it in further.
WDYT?
At the moment I see that it takes 3-4 seconds on the dogfooding
instance for:
- using API
che-theia
fromworkspace-plugin
send a request ontheia
side to add a project as a workspace folder theia
does some actions and send an event that workspace folders were updatedworkspace-plugin
catch the event.
I'm going to create an issue to investigate why it takes 3-4 seconds and if we can reduce such delays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a large timeout is fine: most of the time, it will not be reached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created the issue for the delay investigation eclipse-che/che#19566
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted /projects/che-theia.workspace file, stopped my workspace and restarted it.
Project is there
volX4XVHvX.mp4
it's worth adding a unit test
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
f4941d8
to
566aa15
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@sleshchenko |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it on my local minikube. Project explorer shows the projects structure correctly now. Thanks!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@sleshchenko Do you still need the branch? |
This comment has been minimized.
This comment has been minimized.
[crw-ci-test] |
Both |
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1)
|
Signed-off-by: Roman Nikitenko rnikiten@redhat.com
What does this PR do?
Provide backward compatibility for workspaces which were created before switching multi-root mode to ON by default.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
eclipse-che/che#19551
How to test this PR?
Please see steps defined in eclipse-che/che#19445 (comment)
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.
Happy Path Channel
HAPPY_PATH_CHANNEL=next