From 17abbf197bc5e1ef6b3a3ebb80a43199a3431a9a Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Wed, 8 Jun 2022 18:12:24 +0300 Subject: [PATCH] chore: devWorkspace should be initialized properly if there is no plugins/extensions provided Signed-off-by: Vitaliy Gulyy --- .../src/devfile/che-theia-plugins-devfile-resolver.ts | 4 +++- .../tests/devfile/che-theia-plugins-devfile-resolver.spec.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/devworkspace-handler/src/devfile/che-theia-plugins-devfile-resolver.ts b/tools/devworkspace-handler/src/devfile/che-theia-plugins-devfile-resolver.ts index 2a3fe1fd8..1e69ea8ae 100644 --- a/tools/devworkspace-handler/src/devfile/che-theia-plugins-devfile-resolver.ts +++ b/tools/devworkspace-handler/src/devfile/che-theia-plugins-devfile-resolver.ts @@ -58,8 +58,10 @@ export class CheTheiaPluginsDevfileResolver implements DevfileResolver { cheTheiaPluginsYamlContent = devfileContext.devfile.attributes?.['.che/che-theia-plugins.yaml']; } - // no content, skip + // no content if (!cheTheiaPluginsYamlContent && !vscodeExtensionJsonContent) { + // we have to update the workspace anyway, but without extensions + await this.devWorkspaceUpdater.update(devfileContext, [], [], { extensions: [] }); return; } diff --git a/tools/devworkspace-handler/tests/devfile/che-theia-plugins-devfile-resolver.spec.ts b/tools/devworkspace-handler/tests/devfile/che-theia-plugins-devfile-resolver.spec.ts index ee7000737..e117c0909 100644 --- a/tools/devworkspace-handler/tests/devfile/che-theia-plugins-devfile-resolver.spec.ts +++ b/tools/devworkspace-handler/tests/devfile/che-theia-plugins-devfile-resolver.spec.ts @@ -492,7 +492,7 @@ describe('Test CheTheiaPluginsDevfileResolver', () => { expect(cheTheiaPluginSidecarMergerMergeSpy).toBeCalledTimes(0); expect(cheTheiaPluginDevContainerMergerMergeSpy).toBeCalledTimes(0); - // no update - expect(devWorkspaceUpdaterUpdateMethod).toBeCalledTimes(0); + // devWorkspace should be updated + expect(devWorkspaceUpdaterUpdateMethod).toBeCalledTimes(1); }); });