From e5609bd91eec82c365c3341b778fe7c5938df9e2 Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Wed, 8 Jan 2025 07:56:04 -0800 Subject: [PATCH] Update Playwright to latest and rename MongoProxy development endpoint constant (#2022) * Rename MongoProxy development endpoint constant to be consistent with other endpoints. * Update Playwright version to latest release due to test setup break. --- package-lock.json | 101 ++++++++++++++++++++++++--------- package.json | 4 +- src/Common/Constants.ts | 2 +- src/Common/MongoProxyClient.ts | 18 +++--- src/Explorer/Tabs/Tabs.tsx | 2 +- src/Utils/EndpointUtils.ts | 2 +- 6 files changed, 89 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index c05feec0a..30e5adc90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -122,7 +122,7 @@ "@babel/preset-env": "7.24.7", "@babel/preset-react": "7.24.7", "@babel/preset-typescript": "7.24.7", - "@playwright/test": "1.44.0", + "@playwright/test": "1.49.1", "@testing-library/react": "11.2.3", "@types/applicationinsights-js": "1.0.7", "@types/codemirror": "0.0.56", @@ -10175,34 +10175,18 @@ } }, "node_modules/@playwright/test": { - "version": "1.44.0", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.1.tgz", + "integrity": "sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright": "1.44.0" + "playwright": "1.49.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" - } - }, - "node_modules/@playwright/test/node_modules/playwright": { - "version": "1.44.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright-core": "1.44.0" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "node": ">=18" } }, "node_modules/@polka/url": { @@ -14804,6 +14788,15 @@ "node": ">=8" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bintrees": { "version": "1.0.2", "license": "MIT" @@ -19466,6 +19459,12 @@ "version": "2.0.5", "license": "MIT" }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "node_modules/filesize": { "version": "8.0.7", "dev": true, @@ -20054,6 +20053,19 @@ "version": "1.0.0", "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "license": "MIT", @@ -24160,6 +24172,24 @@ "fsevents": "^1.2.7" } }, + "node_modules/jest-haste-map/node_modules/fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "Upgrade to fsevents v2 to mitigate potential security issues", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + }, + "engines": { + "node": ">= 4.0" + } + }, "node_modules/jest-haste-map/node_modules/jest-worker": { "version": "24.9.0", "license": "MIT", @@ -30798,15 +30828,34 @@ "node": ">=8" } }, - "node_modules/playwright-core": { - "version": "1.44.0", + "node_modules/playwright": { + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", + "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", + "dev": true, + "dependencies": { + "playwright-core": "1.49.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", + "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", "dev": true, - "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/plotly.js-cartesian-dist-min": { diff --git a/package.json b/package.json index 755254b2b..16e80c5e5 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "@babel/preset-env": "7.24.7", "@babel/preset-react": "7.24.7", "@babel/preset-typescript": "7.24.7", - "@playwright/test": "1.44.0", + "@playwright/test": "1.49.1", "@testing-library/react": "11.2.3", "@types/applicationinsights-js": "1.0.7", "@types/codemirror": "0.0.56", @@ -170,10 +170,10 @@ "jest": "29.7.0", "jest-canvas-mock": "2.5.2", "jest-circus": "29.7.0", + "jest-environment-jsdom": "29.7.0", "jest-html-loader": "1.0.0", "jest-react-hooks-shallow": "1.5.1", "jest-trx-results-processor": "3.0.2", - "jest-environment-jsdom": "29.7.0", "less": "3.8.1", "less-loader": "11.1.3", "less-vars-loader": "1.1.0", diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 0c8252509..11f399ba4 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -149,7 +149,7 @@ export class PortalBackendEndpoints { } export class MongoProxyEndpoints { - public static readonly Local: string = "https://localhost:7238"; + public static readonly Development: string = "https://localhost:7238"; public static readonly Mpac: string = "https://cdb-ms-mpac-mp.cosmos.azure.com"; public static readonly Prod: string = "https://cdb-ms-prod-mp.cosmos.azure.com"; public static readonly Fairfax: string = "https://cdb-ff-prod-mp.cosmos.azure.us"; diff --git a/src/Common/MongoProxyClient.ts b/src/Common/MongoProxyClient.ts index 0513d48cc..c509b7fc8 100644 --- a/src/Common/MongoProxyClient.ts +++ b/src/Common/MongoProxyClient.ts @@ -722,63 +722,63 @@ export function getEndpoint(endpoint: string): string { export function useMongoProxyEndpoint(mongoProxyApi: string): boolean { const mongoProxyEnvironmentMap: { [key: string]: string[] } = { [MongoProxyApi.ResourceList]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.QueryDocuments]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.CreateDocument]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.ReadDocument]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.UpdateDocument]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.DeleteDocument]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.CreateCollectionWithProxy]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.LegacyMongoShell]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, MongoProxyEndpoints.Mooncake, ], [MongoProxyApi.BulkDelete]: [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax, diff --git a/src/Explorer/Tabs/Tabs.tsx b/src/Explorer/Tabs/Tabs.tsx index aa06858dc..3314416a6 100644 --- a/src/Explorer/Tabs/Tabs.tsx +++ b/src/Explorer/Tabs/Tabs.tsx @@ -318,7 +318,7 @@ const getReactTabContent = (activeReactTab: ReactTabKind, explorer: Explorer): J const showMongoAndCassandraProxiesNetworkSettingsWarning = (): boolean => { const ipRules: IpRule[] = userContext.databaseAccount?.properties?.ipRules; if ( - ((userContext.apiType === "Mongo" && configContext.MONGO_PROXY_ENDPOINT !== MongoProxyEndpoints.Local) || + ((userContext.apiType === "Mongo" && configContext.MONGO_PROXY_ENDPOINT !== MongoProxyEndpoints.Development) || (userContext.apiType === "Cassandra" && configContext.CASSANDRA_PROXY_ENDPOINT !== CassandraProxyEndpoints.Development)) && ipRules?.length diff --git a/src/Utils/EndpointUtils.ts b/src/Utils/EndpointUtils.ts index 3172deed3..8ed3688f0 100644 --- a/src/Utils/EndpointUtils.ts +++ b/src/Utils/EndpointUtils.ts @@ -93,7 +93,7 @@ export const MongoProxyOutboundIPs: { [key: string]: string[] } = { }; export const defaultAllowedMongoProxyEndpoints: ReadonlyArray = [ - MongoProxyEndpoints.Local, + MongoProxyEndpoints.Development, MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Prod, MongoProxyEndpoints.Fairfax,