From 994a80602fbefe720680b35d93a05b8306a9d273 Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Tue, 12 Dec 2023 06:58:21 +0200 Subject: [PATCH 1/7] fix: upgrade libs Signed-off-by: Oleksii Orel --- .deps/EXCLUDED/dev.md | 1 + .deps/dev.md | 6 +-- .deps/prod.md | 15 +++++-- packages/common/package.json | 2 +- packages/common/src/dto/api/index.ts | 4 +- packages/dashboard-backend/package.json | 4 +- .../__tests__/devWorkspaceApi.spec.ts | 12 +++--- .../__tests__/devWorkspaceTemplateApi.spec.ts | 12 +++--- .../services/devWorkspaceApi.ts | 12 +++--- .../services/devWorkspaceTemplateApi.ts | 12 +++--- .../helpers/devworkspace/constants.ts | 18 ++++++++ .../services/serverConfigApi.ts | 4 +- .../src/devworkspaceClient/types/index.ts | 6 +-- .../__mocks__/getDevWorkspaceClient.ts | 4 +- yarn.lock | 41 +++++++++++++++---- 15 files changed, 103 insertions(+), 50 deletions(-) create mode 100644 packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts diff --git a/.deps/EXCLUDED/dev.md b/.deps/EXCLUDED/dev.md index 5f1ac5d3e..9e4840c96 100644 --- a/.deps/EXCLUDED/dev.md +++ b/.deps/EXCLUDED/dev.md @@ -5,6 +5,7 @@ This file contains a manual contribution to .deps/dev.md and it's needed because | `@babel/runtime-corejs3@7.22.10` | transitive dependency | | `@csstools/media-query-list-parser@2.1.4` | transitive dependency | | `@csstools/selector-specificity@3.0.0` | transitive dependency | +| `@devfile/api@2.2.2-1700686170` | N/A | | `@eslint/js@8.53.0` | transitive dependency | | `@nrwl/nx-darwin-arm64@15.9.7` | transitive dependency | | `@nrwl/nx-darwin-x64@15.9.7` | transitive dependency | diff --git a/.deps/dev.md b/.deps/dev.md index e3717fc4e..ffc5c0bcb 100644 --- a/.deps/dev.md +++ b/.deps/dev.md @@ -47,6 +47,7 @@ | [`@csstools/css-tokenizer@2.2.1`](https://github.com/csstools/postcss-plugins.git) | MIT | clearlydefined | | [`@csstools/media-query-list-parser@2.1.5`](https://github.com/csstools/postcss-plugins.git) | MIT | clearlydefined | | [`@csstools/selector-specificity@3.0.0`](https://github.com/csstools/postcss-plugins.git) | MIT-0 | transitive dependency | +| [`@devfile/api@2.2.2-1700686170`](https://github.com/GIT_USER_ID/GIT_REPO_ID.git) | Apache-2.0 | N/A | | [`@discoveryjs/json-ext@0.5.7`](https://github.com/discoveryjs/json-ext.git) | MIT | clearlydefined | | [`@eslint-community/eslint-utils@4.4.0`](https://github.com/eslint-community/eslint-utils) | MIT | #8032 | | [`@eslint-community/regexpp@4.10.0`](https://github.com/eslint-community/regexpp) | MIT | clearlydefined | @@ -591,6 +592,7 @@ | [`jest-worker@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | | [`jest@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | | [`jsdom@20.0.3`](https://github.com/jsdom/jsdom.git) | MIT | #7436 | +| [`jsesc@2.5.2`](https://github.com/mathiasbynens/jsesc.git) | MIT | clearlydefined | | [`json-buffer@3.0.1`](git://github.com/dominictarr/json-buffer.git) | MIT | clearlydefined | | [`json-parse-better-errors@1.0.2`](https://github.com/zkat/json-parse-better-errors) | MIT | clearlydefined | | [`json-parse-even-better-errors@3.0.0`](https://github.com/npm/json-parse-even-better-errors.git) | MIT | clearlydefined | @@ -782,7 +784,6 @@ | [`pstree.remy@1.1.8`](https://github.com/remy/pstree.git) | MIT | clearlydefined | | [`pure-rand@6.0.4`](git+https://github.com/dubzzz/pure-rand.git) | MIT | #8423 | | [`q@1.5.1`](git://github.com/kriskowal/q.git) | MIT | #1020 | -| [`querystringify@2.2.0`](https://github.com/unshiftio/querystringify) | MIT | clearlydefined | | [`queue-microtask@1.2.3`](git://github.com/feross/queue-microtask.git) | MIT | clearlydefined | | [`quick-lru@4.0.1`](https://github.com/sindresorhus/quick-lru.git) | MIT | clearlydefined | | [`react-test-renderer@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | @@ -802,7 +803,6 @@ | [`relateurl@0.2.7`](git://github.com/stevenvachon/relateurl.git) | MIT | clearlydefined | | [`renderkid@3.0.0`](https://github.com/AriaMinaei/RenderKid.git) | MIT | clearlydefined | | [`require-directory@2.1.1`](git://github.com/troygoode/node-require-directory.git) | MIT | clearlydefined | -| [`requires-port@1.0.0`](https://github.com/unshiftio/requires-port) | MIT | clearlydefined | | [`resolve-cwd@3.0.0`](https://github.com/sindresorhus/resolve-cwd.git) | MIT | clearlydefined | | [`resolve-from@5.0.0`](https://github.com/sindresorhus/resolve-from.git) | MIT | clearlydefined | | [`resolve.exports@2.0.2`](https://github.com/lukeed/resolve.exports.git) | MIT | clearlydefined | @@ -890,6 +890,7 @@ | [`through2@4.0.2`](https://github.com/rvagg/through2.git) | MIT | clearlydefined | | [`through@2.3.8`](https://github.com/dominictarr/through.git) | MIT | #1036 | | [`titleize@3.0.0`](https://github.com/sindresorhus/titleize.git) | MIT | clearlydefined | +| [`to-fast-properties@2.0.0`](https://github.com/sindresorhus/to-fast-properties.git) | MIT | clearlydefined | | [`to-regex-range@5.0.1`](https://github.com/micromatch/to-regex-range.git) | MIT | clearlydefined | | [`totalist@3.0.1`](https://github.com/lukeed/totalist.git) | MIT | clearlydefined | | [`touch@3.1.0`](git://github.com/isaacs/node-touch.git) | ISC | clearlydefined | @@ -920,7 +921,6 @@ | [`untildify@4.0.0`](https://github.com/sindresorhus/untildify.git) | MIT | clearlydefined | | [`upath@2.0.1`](git://github.com/anodynos/upath) | MIT | clearlydefined | | [`update-browserslist-db@1.0.13`](https://github.com/browserslist/update-db.git) | MIT | #8237 | -| [`url-parse@1.5.10`](https://github.com/unshiftio/url-parse.git) | MIT | clearlydefined | | [`utila@0.4.0`](https://github.com/AriaMinaei/utila.git) | MIT | clearlydefined | | [`uuid@8.3.2`](https://github.com/uuidjs/uuid.git) | MIT | #2438 | | [`v8-compile-cache@2.3.0`](https://github.com/zertosh/v8-compile-cache.git) | MIT | clearlydefined | diff --git a/.deps/prod.md b/.deps/prod.md index d5130d5a7..907702f7b 100644 --- a/.deps/prod.md +++ b/.deps/prod.md @@ -3,9 +3,9 @@ | Packages | License | Resolved CQs | | --- | --- | --- | | [`@babel/runtime@7.23.2`](https://github.com/babel/babel.git) | MIT | #10718 | -| [`@devfile/api@2.2.1-alpha-1667236163`](https://github.com/devfile/api.git) | Apache-2.0 | clearlydefined | +| [`@devfile/api@2.2.0-alpha-1637255314`](https://github.com/devfile/api.git) | EPL-2.0 | clearlydefined | | `@eclipse-che/api@7.76.0` | EPL-2.0 | ecd.che | -| [`@eclipse-che/che-devworkspace-generator@7.78.0`](git+https://github.com/eclipse-che/che-devfile-registry.git) | EPL-2.0 | ecd.che | +| [`@eclipse-che/che-devworkspace-generator@7.79.0-next-1427c19`](git+https://github.com/eclipse-che/che-devfile-registry.git) | EPL-2.0 | ecd.che | | [`@eclipse-che/common@7.79.0-next`](https://github.com/eclipse-che/che-dashboard) | EPL-2.0 | ecd.che | | [`@eclipse-che/dashboard-backend@7.79.0-next`](https://github.com/eclipse-che/che-dashboard) | EPL-2.0 | ecd.che | | [`@eclipse-che/dashboard-frontend@7.79.0-next`](git://github.com/eclipse/che-dashboard.git) | EPL-2.0 | ecd.che | @@ -45,6 +45,7 @@ | [`@types/caseless@0.12.4`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/hoist-non-react-statics@3.3.4`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/js-yaml@4.0.8`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | +| [`@types/node-fetch@2.6.9`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #11004 | | [`@types/node@20.8.10`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10804 | | [`@types/prop-types@15.7.9`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/react-redux@7.1.28`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10970 | @@ -123,7 +124,7 @@ | [`create-hash@1.2.0`](git@github.com:crypto-browserify/createHash.git) | MIT | clearlydefined | | [`create-hmac@1.1.7`](https://github.com/crypto-browserify/createHmac.git) | MIT | clearlydefined | | [`crypto-browserify@3.12.0`](git://github.com/crypto-browserify/crypto-browserify.git) | MIT | #1033 | -| [`csstype@3.1.2`](https://github.com/frenic/csstype) | MIT | clearlydefined | +| [`csstype@3.1.2`](https://github.com/frenic/csstype) | MIT | #11847 | | [`dashdash@1.14.1`](git://github.com/trentm/node-dashdash.git) | MIT | clearlydefined | | [`date-fns@2.30.0`](https://github.com/date-fns/date-fns) | MIT | clearlydefined | | [`dateformat@4.6.3`](https://github.com/felixge/node-dateformat.git) | MIT | clearlydefined | @@ -144,6 +145,7 @@ | [`elliptic@6.5.4`](git@github.com:indutny/elliptic) | MIT | [CQ23022](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23022) | | [`end-of-stream@1.4.4`](git://github.com/mafintosh/end-of-stream.git) | MIT | clearlydefined | | [`entities@4.5.0`](git://github.com/fb55/entities.git) | BSD-2-Clause | #7910 | +| [`es6-promise@4.2.8`](git://github.com/stefanpenner/es6-promise.git) | MIT | #2898 | | [`escape-html@1.0.3`](https://github.com/component/escape-html.git) | MIT | clearlydefined | | [`escape-string-regexp@1.0.5`](https://github.com/sindresorhus/escape-string-regexp.git) | MIT | clearlydefined | | [`esutils@2.0.3`](http://github.com/estools/esutils.git) | BSD-2-Clause | #120 | @@ -259,6 +261,7 @@ | [`ms@2.1.2`](https://github.com/zeit/ms.git) | MIT | #5895 | | [`multi-ini@2.3.2`](git://github.com/evangelion1204/multi-ini.git) | MIT | clearlydefined | | [`nanoid@3.3.7`](https://github.com/ai/nanoid.git) | MIT | #7571 | +| [`node-fetch@2.7.0`](https://github.com/bitinn/node-fetch.git) | MIT | #10509 | | [`oauth-sign@0.9.0`](https://github.com/mikeal/oauth-sign) | Apache-2.0 | clearlydefined | | [`object-assign@4.1.1`](https://github.com/sindresorhus/object-assign.git) | MIT | clearlydefined | | [`object-hash@2.2.0`](https://github.com/puleos/object-hash) | MIT | clearlydefined | @@ -298,6 +301,7 @@ | [`punycode@2.3.1`](https://github.com/mathiasbynens/punycode.js.git) | MIT | #6373 | | [`qs@6.11.2`](https://github.com/ljharb/qs.git) | BSD-3-Clause | #7556 | | [`querystring@0.2.1`](git://github.com/Gozala/querystring.git) | MIT | #1054 | +| [`querystringify@2.2.0`](https://github.com/unshiftio/querystringify) | MIT | clearlydefined | | [`quick-format-unescaped@4.0.4`](git+https://github.com/davidmarkclements/quick-format.git) | MIT | clearlydefined | | [`randombytes@2.1.0`](git@github.com:crypto-browserify/randombytes.git) | MIT | clearlydefined | | [`randomfill@1.0.4`](https://github.com/crypto-browserify/randomfill.git) | MIT | clearlydefined | @@ -324,6 +328,7 @@ | [`repeating@2.0.1`](https://github.com/sindresorhus/repeating.git) | MIT | clearlydefined | | [`request@2.88.2`](https://github.com/request/request.git) | Apache-2.0 | #997 | | [`require-from-string@2.0.2`](https://github.com/floatdrop/require-from-string.git) | MIT | clearlydefined | +| [`requires-port@1.0.0`](https://github.com/unshiftio/requires-port) | MIT | clearlydefined | | [`reselect@4.1.8`](https://github.com/reduxjs/reselect.git) | MIT | clearlydefined | | [`resolve-pathname@3.0.0`](https://github.com/mjackson/resolve-pathname.git) | MIT | clearlydefined | | [`ret@0.2.2`](git://github.com/fent/ret.js.git) | MIT | clearlydefined | @@ -376,6 +381,7 @@ | [`toggle-selection@1.0.6`](git+https://github.com/sudodoki/toggle-selection) | MIT | clearlydefined | | [`toidentifier@1.0.1`](https://github.com/component/toidentifier.git) | MIT | clearlydefined | | [`tough-cookie@2.5.0`](git://github.com/salesforce/tough-cookie.git) | BSD-3-Clause | clearlydefined | +| [`tr46@0.0.3`](git+https://github.com/Sebmaster/tr46.js.git) | MIT | clearlydefined | | [`trim-right@1.0.1`](https://github.com/sindresorhus/trim-right.git) | MIT | clearlydefined | | [`tslib@2.6.2`](https://github.com/Microsoft/tslib.git) | 0BSD | #9189 | | [`tunnel-agent@0.6.0`](https://github.com/mikeal/tunnel-agent) | Apache-2.0 | clearlydefined | @@ -386,11 +392,14 @@ | [`undici@5.27.2`](git+https://github.com/nodejs/undici.git) | MIT | clearlydefined | | [`universalify@2.0.1`](git+https://github.com/RyanZim/universalify.git) | MIT | clearlydefined | | [`uri-js@4.4.1`](http://github.com/garycourt/uri-js) | BSD-2-Clause | #1086 | +| [`url-parse@1.5.10`](https://github.com/unshiftio/url-parse.git) | MIT | clearlydefined | | [`util-deprecate@1.0.2`](git://github.com/TooTallNate/util-deprecate.git) | MIT | #5885 | | [`uuid@3.4.0`](https://github.com/uuidjs/uuid.git) | MIT | #2733 | | [`value-equal@1.0.1`](https://github.com/mjackson/value-equal.git) | MIT | clearlydefined | | [`verror@1.10.0`](git://github.com/davepacheco/node-verror.git) | MIT | clearlydefined | | [`warning@4.0.3`](https://github.com/BerkeleyTrue/warning.git) | MIT | [CQ22359](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22359) | +| [`webidl-conversions@3.0.1`](https://github.com/jsdom/webidl-conversions.git) | BSD-2-Clause | clearlydefined | +| [`whatwg-url@5.0.0`](https://github.com/jsdom/whatwg-url.git) | MIT | clearlydefined | | [`wrappy@1.0.2`](https://github.com/npm/wrappy) | ISC | clearlydefined | | [`ws@8.14.2`](git+https://github.com/websockets/ws.git) | MIT | #10503 | | [`yallist@4.0.0`](git+https://github.com/isaacs/yallist.git) | ISC | clearlydefined | diff --git a/packages/common/package.json b/packages/common/package.json index 9d6b7eb16..22189da3c 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -17,7 +17,7 @@ "test:watch": "yarn test --watch" }, "devDependencies": { - "@devfile/api": "^2.2.1-alpha-1667236163", + "@devfile/api": "2.2.2-1700686170", "@kubernetes/client-node": "^0.18.1", "@types/jest": "^29.5.3", "@typescript-eslint/eslint-plugin": "^6.3.0", diff --git a/packages/common/src/dto/api/index.ts b/packages/common/src/dto/api/index.ts index 327f40e8f..b301293dc 100644 --- a/packages/common/src/dto/api/index.ts +++ b/packages/common/src/dto/api/index.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V1alpha2DevWorkspace, V221DevfileComponents } from '@devfile/api'; +import { V1alpha2DevWorkspace, V222DevfileComponents } from '@devfile/api'; import { CoreV1EventList, V1PodList } from '@kubernetes/client-node'; import * as webSocket from './webSocket'; @@ -104,7 +104,7 @@ export interface IServerConfig { }; defaults: { editor: string | undefined; - components: V221DevfileComponents[]; + components: V222DevfileComponents[]; plugins: IWorkspacesDefaultPlugins[]; pvcStrategy: string | undefined; }; diff --git a/packages/dashboard-backend/package.json b/packages/dashboard-backend/package.json index face2d3d8..15cf68696 100644 --- a/packages/dashboard-backend/package.json +++ b/packages/dashboard-backend/package.json @@ -26,8 +26,7 @@ ], "license": "EPL-2.0", "dependencies": { - "@devfile/api": "^2.2.1-alpha-1667236163", - "@eclipse-che/che-devworkspace-generator": "7.78.0", + "@eclipse-che/che-devworkspace-generator": "next", "@fastify/cors": "^8.3.0", "@fastify/error": "^3.3.0", "@fastify/http-proxy": "^9.2.1", @@ -52,6 +51,7 @@ "ws": "^8.13.0" }, "devDependencies": { + "@devfile/api": "2.2.2-1700686170", "@types/args": "^5.0.0", "@types/fs-extra": "^11.0.1", "@types/jest": "^29.5.3", diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts index a1b9ec83d..ad9c212d6 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts @@ -12,18 +12,18 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { - devworkspaceGroup, - devworkspaceLatestVersion, - devworkspacePlural, - V1alpha2DevWorkspace, -} from '@devfile/api'; +import { V1alpha2DevWorkspace } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; import { IncomingMessage } from 'http'; import { DevWorkspaceApiService } from '@/devworkspaceClient/services/devWorkspaceApi'; +import { + devworkspaceGroup, + devworkspaceLatestVersion, + devworkspacePlural, +} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; const namespace = 'user-che'; const name = 'wksp-name'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts index 1f38d4063..e472c9906 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts @@ -12,12 +12,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { - devworkspacetemplateGroup, - devworkspacetemplateLatestVersion, - devworkspacetemplatePlural, - V1alpha2DevWorkspaceTemplate, -} from '@devfile/api'; +import { V1alpha2DevWorkspaceTemplate } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; @@ -26,6 +21,11 @@ import { DevWorkspaceTemplateApiService, DevWorkspaceTemplateList, } from '@/devworkspaceClient/services/devWorkspaceTemplateApi'; +import { + devworkspacetemplateGroup, + devworkspacetemplateLatestVersion, + devworkspacetemplatePlural, +} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; const namespace = 'user-che'; const name = 'tmpl-name'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts index 373265e4f..7e90e47c7 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts @@ -10,18 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import { - devworkspaceGroup, - devworkspaceLatestVersion, - devworkspacePlural, - V1alpha2DevWorkspace, -} from '@devfile/api'; +import { V1alpha2DevWorkspace } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { V1Status } from '@kubernetes/client-node'; import http, { IncomingHttpHeaders } from 'http'; import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + devworkspaceGroup, + devworkspaceLatestVersion, + devworkspacePlural, +} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; import { CustomObjectAPI, prepareCustomObjectAPI, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts index 56c673cb0..8e3c6e501 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts @@ -10,16 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import { - devworkspacetemplateGroup, - devworkspacetemplateLatestVersion, - devworkspacetemplatePlural, - V1alpha2DevWorkspaceTemplate, -} from '@devfile/api'; +import { V1alpha2DevWorkspaceTemplate } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + devworkspacetemplateGroup, + devworkspacetemplateLatestVersion, + devworkspacetemplatePlural, +} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; import { CustomObjectAPI, prepareCustomObjectAPI, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts new file mode 100644 index 000000000..6d8715425 --- /dev/null +++ b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018-2023 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ + +export const devworkspaceGroup = 'workspace.devfile.io'; +export const devworkspacePlural = 'devworkspaces'; +export const devworkspaceLatestVersion = 'v1alpha2'; +export const devworkspacetemplateGroup = 'workspace.devfile.io'; +export const devworkspacetemplatePlural = 'devworkspacetemplates'; +export const devworkspacetemplateLatestVersion = 'v1alpha2'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts index 1df0f7582..1bc6491b4 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221DevfileComponents } from '@devfile/api'; +import { V222DevfileComponents } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { readFileSync } from 'fs'; @@ -131,7 +131,7 @@ export class ServerConfigApiService implements IServerConfigApi { ); } - getDefaultComponents(cheCustomResource: CheClusterCustomResource): V221DevfileComponents[] { + getDefaultComponents(cheCustomResource: CheClusterCustomResource): V222DevfileComponents[] { if (cheCustomResource.spec.devEnvironments?.defaultComponents) { return cheCustomResource.spec.devEnvironments.defaultComponents; } diff --git a/packages/dashboard-backend/src/devworkspaceClient/types/index.ts b/packages/dashboard-backend/src/devworkspaceClient/types/index.ts index 64bc95dc8..40219f3c3 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/types/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/types/index.ts @@ -13,7 +13,7 @@ import { V1alpha2DevWorkspace, V1alpha2DevWorkspaceTemplate, - V221DevfileComponents, + V222DevfileComponents, } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; @@ -144,7 +144,7 @@ export type CheClusterCustomResourceSpecDevEnvironments = { containerBuildConfiguration?: { openShiftSecurityContextConstraint?: string; }; - defaultComponents?: V221DevfileComponents[]; + defaultComponents?: V222DevfileComponents[]; defaultEditor?: string; defaultPlugins?: api.IWorkspacesDefaultPlugins[]; disableContainerBuildCapabilities?: boolean; @@ -270,7 +270,7 @@ export interface IServerConfigApi { * Returns the default components applied to DevWorkspaces. * These default components are meant to be used when a Devfile does not contain any components. */ - getDefaultComponents(cheCustomResource: CheClusterCustomResource): V221DevfileComponents[]; + getDefaultComponents(cheCustomResource: CheClusterCustomResource): V222DevfileComponents[]; /** * Returns the plugin registry. */ diff --git a/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts b/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts index f1c613190..0d8734cc4 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts @@ -15,7 +15,7 @@ import { V1alpha2DevWorkspace, V1alpha2DevWorkspaceTemplate, - V221DevfileComponents, + V222DevfileComponents, } from '@devfile/api'; import { api } from '@eclipse-che/common'; import { IncomingHttpHeaders } from 'http'; @@ -41,7 +41,7 @@ export const stubContainerBuild = { disableContainerBuildCapabilities: true, }; export const stubDashboardWarning = 'Dashboard warning'; -export const stubDefaultComponents: V221DevfileComponents[] = []; +export const stubDefaultComponents: V222DevfileComponents[] = []; export const stubDefaultEditor = undefined; export const stubDefaultPlugins: api.IWorkspacesDefaultPlugins[] = []; export const stubPluginRegistry = { openVSXURL: 'openvsx-url' }; diff --git a/yarn.lock b/yarn.lock index 2bef35d65..8934bbc02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -353,7 +353,19 @@ request "^2.81.0" rewire "^3.0.2" -"@devfile/api@2.2.1-alpha-1667236163", "@devfile/api@^2.2.1-alpha-1667236163": +"@devfile/api@2.2.2-1700686170": + version "2.2.2-1700686170" + resolved "https://registry.yarnpkg.com/@devfile/api/-/api-2.2.2-1700686170.tgz#faf3627f1f9d5df60705813add60b349eb3166bb" + integrity sha512-mCIzvSce4Bu50HNybY0gWtSD1kujnXGvMVkzk0AAKMt1eSIAKtJeuTRPqQcLfrcfMRjF5t+AVOIIJ5LtlEfknA== + dependencies: + "@types/node" "*" + "@types/node-fetch" "^2.5.7" + es6-promise "^4.2.4" + form-data "^2.5.0" + node-fetch "^2.6.0" + url-parse "^1.4.3" + +"@devfile/api@^2.2.1-alpha-1667236163": version "2.2.1-alpha-1667236163" resolved "https://registry.yarnpkg.com/@devfile/api/-/api-2.2.1-alpha-1667236163.tgz#33cf448dae960c071037b32c6c68f96ba26f1990" integrity sha512-tspoTrbyMbPIVwTD2qr6ljvQAJLE1lCN6uBFIGcYXKw89JGt0s0+WLQ/qIh2+RP5pDpDWbDp/yNFKCmzaOLupg== @@ -374,12 +386,12 @@ resolved "https://registry.yarnpkg.com/@eclipse-che/api/-/api-7.76.0.tgz#4e51015b566df5a9843d32d4de040875da78e368" integrity sha512-V7egXY0x5Ce9DJGLrjXEeBkA/0854C9oz+KhxzCT/mXYbVVj4+YbNFjiuufNRnuGOBOOVCOLhhe69ebODjCiQQ== -"@eclipse-che/che-devworkspace-generator@7.78.0": - version "7.78.0" - resolved "https://registry.yarnpkg.com/@eclipse-che/che-devworkspace-generator/-/che-devworkspace-generator-7.78.0.tgz#75817ba92f0f68293e10fa5389266af8495701d8" - integrity sha512-A8eYJAHZqupSLt3yaNgCfGXfDOswatQBiDXFhKghIfscDYE0+ExQW5KxwtRgT5kszPqeupvsRqLWmmuqgsOe2Q== +"@eclipse-che/che-devworkspace-generator@next": + version "7.79.0-next-1427c19" + resolved "https://registry.yarnpkg.com/@eclipse-che/che-devworkspace-generator/-/che-devworkspace-generator-7.79.0-next-1427c19.tgz#2530b87d3e551b2c71ebb84e3e2e15c8229c0a19" + integrity sha512-eIu2bW165I4UzYFdpFQ1c2JXU1qGd7RRO4ITWE4To372+Cq1DTKNMjhVdj40DDeU2Pw1UjYh3Rr0flS7KBAUbg== dependencies: - "@devfile/api" "2.2.1-alpha-1667236163" + "@devfile/api" "2.2.2-1700686170" axios "1.6.0" fs-extra "^10.0.0" inversify "^5.0.1" @@ -1824,6 +1836,14 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.4.tgz#81f886786411c45bba3f33e781ab48bd56bfca2e" integrity sha512-Kfe/D3hxHTusnPNRbycJE1N77WHDsdS4AjUYIzlDzhDrS47NrwuL3YW4VITxwR7KCVpzwgy4Rbj829KSSQmwXQ== +"@types/node-fetch@^2.5.7": + version "2.6.9" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e" + integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA== + dependencies: + "@types/node" "*" + form-data "^4.0.0" + "@types/node@*", "@types/node@^20.4.9": version "20.8.10" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.10.tgz#a5448b895c753ae929c26ce85cab557c6d4a365e" @@ -4591,6 +4611,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es6-promise@^4.2.4: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -8181,7 +8206,7 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.7: +node-fetch@^2.6.0, node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -11690,7 +11715,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -url-parse@^1.5.3: +url-parse@^1.4.3, url-parse@^1.5.3: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== From 185cb76515185229ae093f3891d8111689c9715d Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Tue, 12 Dec 2023 17:19:52 +0200 Subject: [PATCH 2/7] fixup! fix: upgrade libs --- packages/dashboard-frontend/package.json | 2 +- .../Apply/Devfile/getGitRemotes.ts | 6 +-- .../Apply/Devfile/getProjectFromLocation.ts | 4 +- .../src/services/devfile/converters.ts | 14 ------ .../src/services/devfileApi/devfile/index.ts | 4 +- .../services/devfileApi/devfile/metadata.ts | 4 +- .../src/services/devfileApi/devfileApi.ts | 44 ++++++++++++++++++- .../devworkspace/devWorkspaceClient.ts | 4 +- .../FactoryResolver/__tests__/index.spec.ts | 10 +---- .../__tests__/normalizeDevfileV2.spec.ts | 4 +- .../FactoryResolver/normalizeDevfileV2.ts | 4 +- .../store/Workspaces/devWorkspaces/index.ts | 12 ++++- yarn.lock | 11 ----- 13 files changed, 71 insertions(+), 52 deletions(-) diff --git a/packages/dashboard-frontend/package.json b/packages/dashboard-frontend/package.json index a91a3cb18..75ef0ccf9 100644 --- a/packages/dashboard-frontend/package.json +++ b/packages/dashboard-frontend/package.json @@ -70,7 +70,7 @@ "stream-browserify": "^3.0.0" }, "devDependencies": { - "@devfile/api": "^2.2.1-alpha-1667236163", + "@devfile/api": "2.2.2-1700686170", "@eclipse-che/api": "^7.18.1", "@kubernetes/client-node": "^0.18.1", "@react-mock/state": "^0.1.8", diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts index b63d521c2..f7db2344c 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221DevfileProjects, V221DevfileProjectsItemsGit } from '@devfile/api'; +import { V222DevfileProjects, V222DevfileProjectsItemsGit } from '@devfile/api'; import common from '@eclipse-che/common'; import { getProjectFromLocation } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation'; @@ -149,7 +149,7 @@ export function configureProjectRemotes( /** * Returns the Git project to replace remotes for */ -function getGitProjectForConfiguringRemotes(projects: V221DevfileProjects[] | undefined) { +function getGitProjectForConfiguringRemotes(projects: V222DevfileProjects[] | undefined) { if (!projects) { return undefined; } @@ -175,7 +175,7 @@ function getGitProjectForConfiguringRemotes(projects: V221DevfileProjects[] | un * @param newRemotes The array of new Git remotes to add */ function addRemotesToProject( - gitProject: V221DevfileProjectsItemsGit, + gitProject: V222DevfileProjectsItemsGit, checkoutRemote: GitRemote, newRemotes: GitRemote[], ): void { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts index c8a6f94e6..e4a92b655 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221DevfileProjects } from '@devfile/api'; +import { V222DevfileProjects } from '@devfile/api'; import { FactoryLocationAdapter } from '@/services/factory-location-adapter'; import { getProjectName } from '@/services/helpers/getProjectName'; @@ -18,7 +18,7 @@ import { getProjectName } from '@/services/helpers/getProjectName'; export function getProjectFromLocation( location: string, remoteName = 'origin', -): V221DevfileProjects { +): V222DevfileProjects { const name = getProjectName(location); if (FactoryLocationAdapter.isSshLocation(location)) { const origin = location; diff --git a/packages/dashboard-frontend/src/services/devfile/converters.ts b/packages/dashboard-frontend/src/services/devfile/converters.ts index 6ea35f2ac..4828ed105 100644 --- a/packages/dashboard-frontend/src/services/devfile/converters.ts +++ b/packages/dashboard-frontend/src/services/devfile/converters.ts @@ -14,20 +14,6 @@ import * as devfileConverter from '@eclipse-che/devfile-converter'; import devfileApi from '@/services/devfileApi'; -export async function convertDevfileV2toDevfileV1( - devfile: devfileApi.Devfile, - optionalFilesContent: - | { - [fileName: string]: string; - } - | undefined, -): Promise { - const externalAccess = async function (file: string): Promise { - return optionalFilesContent?.[file] || ''; - }; - return (await devfileConverter.v2ToV1(devfile, externalAccess)) as che.WorkspaceDevfile; -} - export async function convertDevfileV1toDevfileV2( devfile: che.WorkspaceDevfile, ): Promise { diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts b/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts index 8e186b44d..6161ef9d2 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts @@ -10,11 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221Devfile } from '@devfile/api'; +import { V222Devfile } from '@devfile/api'; import { DevfileMetadata, DevfileMetadataLike } from '@/services/devfileApi/devfile/metadata'; -export type DevfileLike = V221Devfile & { +export type DevfileLike = V222Devfile & { metadata?: DevfileMetadataLike; }; diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfile/metadata.ts b/packages/dashboard-frontend/src/services/devfileApi/devfile/metadata.ts index 1880d5414..0fc7a6203 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfile/metadata.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfile/metadata.ts @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221DevfileMetadata } from '@devfile/api'; +import { V222DevfileMetadata } from '@devfile/api'; -export type DevfileMetadataLike = V221DevfileMetadata & { +export type DevfileMetadataLike = V222DevfileMetadata & { namespace?: string; generateName?: string; }; diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts index d47c29622..c3ec7ed19 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts @@ -18,4 +18,46 @@ export { DevWorkspaceSpec } from './devWorkspace/spec'; export { DevWorkspaceSpecTemplate } from './devWorkspace/spec/template'; export { DevWorkspaceTemplate, DevWorkspaceTemplateLike } from './devWorkspaceTemplate'; export { DevWorkspaceTemplateMetadata } from './devWorkspaceTemplate/metadata'; -export { V1alpha2DevWorkspaceStatus as DevWorkspaceStatus } from '@devfile/api'; + +export declare class DevWorkspaceStatus { + 'conditions'?: Array; + 'devworkspaceId': string; + 'mainUrl'?: string; + 'message'?: string; + 'phase'?: string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} +export declare class DevWorkspaceConditions { + 'lastTransitionTime'?: Date; + 'message'?: string; + 'reason'?: string; + 'status': string; + 'type': string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts index b56ab659c..d7473c560 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts @@ -14,7 +14,7 @@ import { V1alpha2DevWorkspaceSpecTemplateComponents, V1alpha2DevWorkspaceTemplateSpec, V1alpha2DevWorkspaceTemplateSpecComponents, - V221DevfileComponentsItemsContainer, + V222DevfileComponentsItemsContainer, } from '@devfile/api'; import { api } from '@eclipse-che/common'; import { inject, injectable } from 'inversify'; @@ -60,7 +60,7 @@ export const DEVWORKSPACE_DEVFILE = 'che.eclipse.org/devfile'; export const DEVWORKSPACE_METADATA_ANNOTATION = 'dw.metadata.annotations'; -export interface ICheEditorOverrideContainer extends V221DevfileComponentsItemsContainer { +export interface ICheEditorOverrideContainer extends V222DevfileComponentsItemsContainer { name: string; } export interface ICheEditorYaml { diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts index a828ca264..a22583829 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts @@ -17,10 +17,7 @@ import { ThunkDispatch } from 'redux-thunk'; import * as factoryResolver from '@/services/backend-client/factoryApi'; import * as yamlResolver from '@/services/backend-client/yamlResolverApi'; -import { - convertDevfileV1toDevfileV2, - convertDevfileV2toDevfileV1, -} from '@/services/devfile/converters'; +import { convertDevfileV1toDevfileV2 } from '@/services/devfile/converters'; import devfileApi from '@/services/devfileApi'; import { AppState } from '@/store'; import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; @@ -40,11 +37,6 @@ jest.mock('../normalizeDevfileV2.ts'); }); jest.mock('../../../services/devfile/converters'); -(convertDevfileV2toDevfileV1 as jest.Mock).mockImplementation(async () => { - return { - apiVersion: '1.0.0', - } as che.WorkspaceDevfile; -}); (convertDevfileV1toDevfileV2 as jest.Mock).mockImplementation(async () => { return { schemaVersion: '2.0.0', diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts index 86fb84e24..1774ce994 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts @@ -10,14 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221DevfileComponents } from '@devfile/api'; +import { V222DevfileComponents } from '@devfile/api'; import devfileApi from '@/services/devfileApi'; import { FactoryResolver } from '@/services/helpers/types'; import normalizeDevfileV2 from '@/store/FactoryResolver/normalizeDevfileV2'; describe('Normalize Devfile V2', () => { - let defaultComponents: V221DevfileComponents[]; + let defaultComponents: V222DevfileComponents[]; beforeEach(() => { defaultComponents = [ diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts b/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts index fa3e5e47d..b4e4865bb 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V221DevfileComponents } from '@devfile/api'; +import { V222DevfileComponents } from '@devfile/api'; import { dump } from 'js-yaml'; import { cloneDeep } from 'lodash'; @@ -39,7 +39,7 @@ export default function normalizeDevfileV2( devfileLike: devfileApi.DevfileLike, data: FactoryResolver, location: string, - defaultComponents: V221DevfileComponents[], + defaultComponents: V222DevfileComponents[], namespace: string, factoryParams: Partial, ): devfileApi.Devfile { diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts index dc755c113..d5c5d5d84 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts @@ -11,6 +11,7 @@ */ import common, { api, ApplicationId } from '@eclipse-che/common'; +import { AxiosResponse } from 'axios'; import { dump } from 'js-yaml'; import { Action, Reducer } from 'redux'; @@ -366,7 +367,16 @@ export const actionCreators: ActionCreators = { getDevWorkspaceClient().checkForDevWorkspaceError(startingWorkspace); } catch (e) { // Skip unauthorised errors. The page is redirecting to an SCM authentication page. - if (common.helpers.errors.includesAxiosResponse(e) && isOAuthResponse(e.response.data)) { + if ( + common.helpers.errors.includesAxiosResponse(e) && + isOAuthResponse( + ( + e as { + response: AxiosResponse; + } + ).response.data, + ) + ) { return; } const errorMessage = diff --git a/yarn.lock b/yarn.lock index 8934bbc02..78197b23d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -365,17 +365,6 @@ node-fetch "^2.6.0" url-parse "^1.4.3" -"@devfile/api@^2.2.1-alpha-1667236163": - version "2.2.1-alpha-1667236163" - resolved "https://registry.yarnpkg.com/@devfile/api/-/api-2.2.1-alpha-1667236163.tgz#33cf448dae960c071037b32c6c68f96ba26f1990" - integrity sha512-tspoTrbyMbPIVwTD2qr6ljvQAJLE1lCN6uBFIGcYXKw89JGt0s0+WLQ/qIh2+RP5pDpDWbDp/yNFKCmzaOLupg== - dependencies: - "@types/bluebird" "3.5.21" - "@types/request" "*" - bluebird "^3.5.0" - request "^2.81.0" - rewire "^3.0.2" - "@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.0": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" From 790f4897988b1821d78c7413c4d5f380bdf05cd3 Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Wed, 13 Dec 2023 14:12:09 +0200 Subject: [PATCH 3/7] Update packages/dashboard-backend/package.json Co-authored-by: Oleksii Kurinnyi --- packages/dashboard-backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dashboard-backend/package.json b/packages/dashboard-backend/package.json index 15cf68696..1f317bd6d 100644 --- a/packages/dashboard-backend/package.json +++ b/packages/dashboard-backend/package.json @@ -26,7 +26,7 @@ ], "license": "EPL-2.0", "dependencies": { - "@eclipse-che/che-devworkspace-generator": "next", + "@eclipse-che/che-devworkspace-generator": "7.79.0-next-1427c19", "@fastify/cors": "^8.3.0", "@fastify/error": "^3.3.0", "@fastify/http-proxy": "^9.2.1", From 5cf01fa00b7daf4add1cbfc2c3536195df116767 Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Wed, 13 Dec 2023 16:56:00 +0200 Subject: [PATCH 4/7] fix: import @devfile/api constants; revert unnecessary changes; Signed-off-by: Oleksii Kurinnyi --- packages/dashboard-backend/jest.config.js | 7 +++ .../__tests__/devWorkspaceApi.spec.ts | 6 +-- .../__tests__/devWorkspaceTemplateApi.spec.ts | 10 ++--- .../services/devWorkspaceApi.ts | 6 +-- .../services/devWorkspaceTemplateApi.ts | 10 ++--- .../helpers/devworkspace/constants.ts | 18 -------- .../webpack.config.common.js | 4 ++ .../src/services/devfileApi/devfileApi.ts | 44 +------------------ .../store/Workspaces/devWorkspaces/index.ts | 12 +---- 9 files changed, 25 insertions(+), 92 deletions(-) delete mode 100644 packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts diff --git a/packages/dashboard-backend/jest.config.js b/packages/dashboard-backend/jest.config.js index 7fe296e05..873107085 100644 --- a/packages/dashboard-backend/jest.config.js +++ b/packages/dashboard-backend/jest.config.js @@ -21,7 +21,14 @@ module.exports = { moduleNameMapper: { // mapping for absolute imports (see tsconfig.json) '^@/(.*)$': '/src/$1', + + // not everything we need is exported from the package + // so we need to alias the rest + '@devfile/api/api': '/../../node_modules/@devfile/api/api.ts', }, + transformIgnorePatterns: [ + 'node_modules/(?!@devfile/api)', + ], collectCoverageFrom: [ ...base.collectCoverageFrom, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts index ad9c212d6..6e816ddfb 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts @@ -13,17 +13,13 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { V1alpha2DevWorkspace } from '@devfile/api'; +import { devworkspaceGroup, devworkspaceLatestVersion, devworkspacePlural } from '@devfile/api/api'; import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; import { IncomingMessage } from 'http'; import { DevWorkspaceApiService } from '@/devworkspaceClient/services/devWorkspaceApi'; -import { - devworkspaceGroup, - devworkspaceLatestVersion, - devworkspacePlural, -} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; const namespace = 'user-che'; const name = 'wksp-name'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts index e472c9906..1c1b9dabc 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts @@ -13,6 +13,11 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { V1alpha2DevWorkspaceTemplate } from '@devfile/api'; +import { + devworkspacetemplateGroup, + devworkspacetemplateLatestVersion, + devworkspacetemplatePlural, +} from '@devfile/api/api'; import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; @@ -21,11 +26,6 @@ import { DevWorkspaceTemplateApiService, DevWorkspaceTemplateList, } from '@/devworkspaceClient/services/devWorkspaceTemplateApi'; -import { - devworkspacetemplateGroup, - devworkspacetemplateLatestVersion, - devworkspacetemplatePlural, -} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; const namespace = 'user-che'; const name = 'tmpl-name'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts index 7e90e47c7..c67056fa9 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts @@ -11,17 +11,13 @@ */ import { V1alpha2DevWorkspace } from '@devfile/api'; +import { devworkspaceGroup, devworkspaceLatestVersion, devworkspacePlural } from '@devfile/api/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { V1Status } from '@kubernetes/client-node'; import http, { IncomingHttpHeaders } from 'http'; import { createError } from '@/devworkspaceClient/services/helpers/createError'; -import { - devworkspaceGroup, - devworkspaceLatestVersion, - devworkspacePlural, -} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; import { CustomObjectAPI, prepareCustomObjectAPI, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts index 8e3c6e501..971a751ca 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts @@ -11,15 +11,15 @@ */ import { V1alpha2DevWorkspaceTemplate } from '@devfile/api'; -import { api } from '@eclipse-che/common'; -import * as k8s from '@kubernetes/client-node'; - -import { createError } from '@/devworkspaceClient/services/helpers/createError'; import { devworkspacetemplateGroup, devworkspacetemplateLatestVersion, devworkspacetemplatePlural, -} from '@/devworkspaceClient/services/helpers/devworkspace/constants'; +} from '@devfile/api/api'; +import { api } from '@eclipse-che/common'; +import * as k8s from '@kubernetes/client-node'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; import { CustomObjectAPI, prepareCustomObjectAPI, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts deleted file mode 100644 index 6d8715425..000000000 --- a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/devworkspace/constants.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2018-2023 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ - -export const devworkspaceGroup = 'workspace.devfile.io'; -export const devworkspacePlural = 'devworkspaces'; -export const devworkspaceLatestVersion = 'v1alpha2'; -export const devworkspacetemplateGroup = 'workspace.devfile.io'; -export const devworkspacetemplatePlural = 'devworkspacetemplates'; -export const devworkspacetemplateLatestVersion = 'v1alpha2'; diff --git a/packages/dashboard-backend/webpack.config.common.js b/packages/dashboard-backend/webpack.config.common.js index ddd8496ac..d7d6d3318 100644 --- a/packages/dashboard-backend/webpack.config.common.js +++ b/packages/dashboard-backend/webpack.config.common.js @@ -44,6 +44,10 @@ module.exports = () => { alias: { // alias for absolute imports (see tsconfig.json) '@': path.resolve(__dirname, 'src/'), + + // not everything we need is exported from the package + // so we need to alias the rest + '@devfile/api/api': path.resolve(__dirname, '../../node_modules/@devfile/api/api.ts'), }, }, resolveLoader: {}, diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts index c3ec7ed19..d47c29622 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts @@ -18,46 +18,4 @@ export { DevWorkspaceSpec } from './devWorkspace/spec'; export { DevWorkspaceSpecTemplate } from './devWorkspace/spec/template'; export { DevWorkspaceTemplate, DevWorkspaceTemplateLike } from './devWorkspaceTemplate'; export { DevWorkspaceTemplateMetadata } from './devWorkspaceTemplate/metadata'; - -export declare class DevWorkspaceStatus { - 'conditions'?: Array; - 'devworkspaceId': string; - 'mainUrl'?: string; - 'message'?: string; - 'phase'?: string; - static readonly discriminator: string | undefined; - static readonly attributeTypeMap: Array<{ - name: string; - baseName: string; - type: string; - format: string; - }>; - static getAttributeTypeMap(): { - name: string; - baseName: string; - type: string; - format: string; - }[]; - constructor(); -} -export declare class DevWorkspaceConditions { - 'lastTransitionTime'?: Date; - 'message'?: string; - 'reason'?: string; - 'status': string; - 'type': string; - static readonly discriminator: string | undefined; - static readonly attributeTypeMap: Array<{ - name: string; - baseName: string; - type: string; - format: string; - }>; - static getAttributeTypeMap(): { - name: string; - baseName: string; - type: string; - format: string; - }[]; - constructor(); -} +export { V1alpha2DevWorkspaceStatus as DevWorkspaceStatus } from '@devfile/api'; diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts index d5c5d5d84..dc755c113 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts @@ -11,7 +11,6 @@ */ import common, { api, ApplicationId } from '@eclipse-che/common'; -import { AxiosResponse } from 'axios'; import { dump } from 'js-yaml'; import { Action, Reducer } from 'redux'; @@ -367,16 +366,7 @@ export const actionCreators: ActionCreators = { getDevWorkspaceClient().checkForDevWorkspaceError(startingWorkspace); } catch (e) { // Skip unauthorised errors. The page is redirecting to an SCM authentication page. - if ( - common.helpers.errors.includesAxiosResponse(e) && - isOAuthResponse( - ( - e as { - response: AxiosResponse; - } - ).response.data, - ) - ) { + if (common.helpers.errors.includesAxiosResponse(e) && isOAuthResponse(e.response.data)) { return; } const errorMessage = From 769c2189b2b55e1850b247ed9946efff49180d17 Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Wed, 13 Dec 2023 18:48:30 +0200 Subject: [PATCH 5/7] fixup! fix: import @devfile/api constants; revert unnecessary changes; --- packages/dashboard-backend/jest.config.js | 2 +- packages/dashboard-frontend/jest.config.js | 7 +++++++ yarn.lock | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/dashboard-backend/jest.config.js b/packages/dashboard-backend/jest.config.js index 873107085..97eff2c81 100644 --- a/packages/dashboard-backend/jest.config.js +++ b/packages/dashboard-backend/jest.config.js @@ -24,7 +24,7 @@ module.exports = { // not everything we need is exported from the package // so we need to alias the rest - '@devfile/api/api': '/../../node_modules/@devfile/api/api.ts', + '@devfile/api/(.*)$': '/../../node_modules/@devfile/api/$1.ts', }, transformIgnorePatterns: [ 'node_modules/(?!@devfile/api)', diff --git a/packages/dashboard-frontend/jest.config.js b/packages/dashboard-frontend/jest.config.js index 12a702399..9c06c4ce4 100644 --- a/packages/dashboard-frontend/jest.config.js +++ b/packages/dashboard-frontend/jest.config.js @@ -21,7 +21,14 @@ module.exports = { '\\.(gif|ttf|eot|svg)$': '/__mocks__/fileMock.js', // mapping for absolute imports (see tsconfig.json) '^@/(.*)$': '/src/$1', + + // not everything we need is exported from the package + // so we need to alias the rest + '^@devfile/api$': '/../../node_modules/@devfile/api/index.ts', }, + transformIgnorePatterns: [ + 'node_modules/(?!@devfile/api)', + ], modulePathIgnorePatterns: [ '__mocks__/index.tsx', ], diff --git a/yarn.lock b/yarn.lock index 78197b23d..0c563764a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -375,7 +375,7 @@ resolved "https://registry.yarnpkg.com/@eclipse-che/api/-/api-7.76.0.tgz#4e51015b566df5a9843d32d4de040875da78e368" integrity sha512-V7egXY0x5Ce9DJGLrjXEeBkA/0854C9oz+KhxzCT/mXYbVVj4+YbNFjiuufNRnuGOBOOVCOLhhe69ebODjCiQQ== -"@eclipse-che/che-devworkspace-generator@next": +"@eclipse-che/che-devworkspace-generator@7.79.0-next-1427c19": version "7.79.0-next-1427c19" resolved "https://registry.yarnpkg.com/@eclipse-che/che-devworkspace-generator/-/che-devworkspace-generator-7.79.0-next-1427c19.tgz#2530b87d3e551b2c71ebb84e3e2e15c8229c0a19" integrity sha512-eIu2bW165I4UzYFdpFQ1c2JXU1qGd7RRO4ITWE4To372+Cq1DTKNMjhVdj40DDeU2Pw1UjYh3Rr0flS7KBAUbg== From 765d1e21c305a88303ef0025ce6b003d433f02d7 Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Thu, 14 Dec 2023 13:48:16 +0200 Subject: [PATCH 6/7] fixup! fixup! fix: import @devfile/api constants; revert unnecessary changes; --- packages/dashboard-frontend/jest.config.js | 7 ------- .../src/services/devfileApi/devfileApi.ts | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/dashboard-frontend/jest.config.js b/packages/dashboard-frontend/jest.config.js index 9c06c4ce4..12a702399 100644 --- a/packages/dashboard-frontend/jest.config.js +++ b/packages/dashboard-frontend/jest.config.js @@ -21,14 +21,7 @@ module.exports = { '\\.(gif|ttf|eot|svg)$': '/__mocks__/fileMock.js', // mapping for absolute imports (see tsconfig.json) '^@/(.*)$': '/src/$1', - - // not everything we need is exported from the package - // so we need to alias the rest - '^@devfile/api$': '/../../node_modules/@devfile/api/index.ts', }, - transformIgnorePatterns: [ - 'node_modules/(?!@devfile/api)', - ], modulePathIgnorePatterns: [ '__mocks__/index.tsx', ], diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts index d47c29622..5301ccf1f 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts @@ -10,6 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ +import { V1alpha2DevWorkspaceStatus } from '@devfile/api'; + export { Devfile, DevfileLike } from './devfile'; export { DevfileMetadata } from './devfile/metadata'; export { DevWorkspace, DevWorkspaceKind, DevWorkspaceLike } from './devWorkspace'; @@ -18,4 +20,5 @@ export { DevWorkspaceSpec } from './devWorkspace/spec'; export { DevWorkspaceSpecTemplate } from './devWorkspace/spec/template'; export { DevWorkspaceTemplate, DevWorkspaceTemplateLike } from './devWorkspaceTemplate'; export { DevWorkspaceTemplateMetadata } from './devWorkspaceTemplate/metadata'; -export { V1alpha2DevWorkspaceStatus as DevWorkspaceStatus } from '@devfile/api'; + +export interface DevWorkspaceStatus extends V1alpha2DevWorkspaceStatus {} From 1e3592ae534b9fd924d771993d436c450765f9e5 Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Thu, 14 Dec 2023 15:14:09 +0200 Subject: [PATCH 7/7] fixup! fixup! fixup! fix: import @devfile/api constants; revert unnecessary changes; --- .../dashboard-frontend/src/services/devfileApi/devfileApi.ts | 4 ---- .../src/store/Workspaces/devWorkspaces/index.ts | 3 ++- .../src/store/__mocks__/devWorkspaceBuilder.ts | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts index 5301ccf1f..39dbff974 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts @@ -10,8 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import { V1alpha2DevWorkspaceStatus } from '@devfile/api'; - export { Devfile, DevfileLike } from './devfile'; export { DevfileMetadata } from './devfile/metadata'; export { DevWorkspace, DevWorkspaceKind, DevWorkspaceLike } from './devWorkspace'; @@ -20,5 +18,3 @@ export { DevWorkspaceSpec } from './devWorkspace/spec'; export { DevWorkspaceSpecTemplate } from './devWorkspace/spec/template'; export { DevWorkspaceTemplate, DevWorkspaceTemplateLike } from './devWorkspaceTemplate'; export { DevWorkspaceTemplateMetadata } from './devWorkspaceTemplate/metadata'; - -export interface DevWorkspaceStatus extends V1alpha2DevWorkspaceStatus {} diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts index dc755c113..a7049ae5e 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts @@ -10,6 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ +import { V1alpha2DevWorkspaceStatus } from '@devfile/api'; import common, { api, ApplicationId } from '@eclipse-che/common'; import { dump } from 'js-yaml'; import { Action, Reducer } from 'redux'; @@ -1086,7 +1087,7 @@ export const reducer: Reducer = ( if (WorkspaceAdapter.getUID(workspace) === action.workspaceUID) { const targetWorkspace = Object.assign({}, workspace); if (!targetWorkspace.status) { - targetWorkspace.status = {} as devfileApi.DevWorkspaceStatus; + targetWorkspace.status = {} as V1alpha2DevWorkspaceStatus; } targetWorkspace.status.phase = DevWorkspaceStatus.TERMINATING; targetWorkspace.status.message = action.message; diff --git a/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts b/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts index 61f3f6c93..a3f498dab 100644 --- a/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts +++ b/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V1alpha2DevWorkspaceStatusConditions } from '@devfile/api'; +import { V1alpha2DevWorkspaceStatus, V1alpha2DevWorkspaceStatusConditions } from '@devfile/api'; import devfileApi from '@/services/devfileApi'; import { DevWorkspacePlugin } from '@/services/devfileApi/devWorkspace'; @@ -35,7 +35,7 @@ export class DevWorkspaceBuilder { }, }; - private buildStatus(id?: string): devfileApi.DevWorkspaceStatus { + private buildStatus(id?: string): V1alpha2DevWorkspaceStatus { return { devworkspaceId: id ? id