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 1/8] 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, From 7c9802c07d3ab07bb75d8d66da7ac969b3c2211b Mon Sep 17 00:00:00 2001 From: bogercraig <124094535+bogercraig@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:42:03 -0800 Subject: [PATCH 2/8] Settings Menu Client Refresh Bug Fix, Limit Client Options in APIs (#2023) * Reset hasDataPlaneRbacSettingChanged back to false after cosmos client is refreshed with new settings. Dispose of old client before new one is created. * Update client refresh variable after settings change. * Only refresh client when related settings are changed. * Update comparisons in settings menu. * Remove unnecessary comments. * Update refresh variable naming. * Attempting to sync package.json and package-lock.json in CI. * Remove npm install from CI after successful CI run. * Only show retry settings with those APIs using the cosmos client -> NoSQL, Table, Gremlin --- src/Common/CosmosClient.ts | 13 +- .../Panes/SettingsPane/SettingsPane.tsx | 162 +++++++++--------- src/UserContext.ts | 2 +- 3 files changed, 95 insertions(+), 82 deletions(-) diff --git a/src/Common/CosmosClient.ts b/src/Common/CosmosClient.ts index f7a4fbfc5..2779e1ba1 100644 --- a/src/Common/CosmosClient.ts +++ b/src/Common/CosmosClient.ts @@ -8,7 +8,7 @@ import { AuthType } from "../AuthType"; import { BackendApi, PriorityLevel } from "../Common/Constants"; import * as Logger from "../Common/Logger"; import { Platform, configContext } from "../ConfigContext"; -import { userContext } from "../UserContext"; +import { updateUserContext, userContext } from "../UserContext"; import { logConsoleError } from "../Utils/NotificationConsoleUtils"; import * as PriorityBasedExecutionUtils from "../Utils/PriorityBasedExecutionUtils"; import { EmulatorMasterKey, HttpHeaders } from "./Constants"; @@ -189,10 +189,19 @@ let _client: Cosmos.CosmosClient; export function client(): Cosmos.CosmosClient { if (_client) { - if (!userContext.hasDataPlaneRbacSettingChanged) { + if (!userContext.refreshCosmosClient) { return _client; } + _client.dispose(); + _client = null; } + + if (userContext.refreshCosmosClient) { + updateUserContext({ + refreshCosmosClient: false, + }); + } + let _defaultHeaders: Cosmos.CosmosHeaders = {}; _defaultHeaders["x-ms-cosmos-sdk-supportedcapabilities"] = SDKSupportedCapabilities.None | SDKSupportedCapabilities.PartitionMerge; diff --git a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx index 12b5a8c47..aedf517eb 100644 --- a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx +++ b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx @@ -193,6 +193,17 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ LocalStorageUtility.setEntryNumber(StorageKey.CustomItemPerPage, customItemPerPage); + if ( + enableDataPlaneRBACOption !== LocalStorageUtility.getEntryString(StorageKey.DataPlaneRbacEnabled) || + retryAttempts !== LocalStorageUtility.getEntryNumber(StorageKey.RetryAttempts) || + retryInterval !== LocalStorageUtility.getEntryNumber(StorageKey.RetryInterval) || + MaxWaitTimeInSeconds !== LocalStorageUtility.getEntryNumber(StorageKey.MaxWaitTimeInSeconds) + ) { + updateUserContext({ + refreshCosmosClient: true, + }); + } + if (configContext.platform !== Platform.Fabric) { LocalStorageUtility.setEntryString(StorageKey.DataPlaneRbacEnabled, enableDataPlaneRBACOption); if ( @@ -202,7 +213,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ ) { updateUserContext({ dataPlaneRbacEnabled: true, - hasDataPlaneRbacSettingChanged: true, }); useDataPlaneRbac.setState({ dataPlaneRbacEnabled: true }); try { @@ -226,7 +236,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ } else { updateUserContext({ dataPlaneRbacEnabled: false, - hasDataPlaneRbacSettingChanged: true, }); const { databaseAccount: account, subscriptionId, resourceGroup } = userContext; if (!userContext.features.enableAadDataPlane && !userContext.masterKey) { @@ -564,7 +573,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ )} - {userContext.apiType === "SQL" && ( <> @@ -663,78 +671,79 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ )} - - - -
Retry Settings
-
- -
-
- Retry policy associated with throttled requests during CosmosDB queries. + {(userContext.apiType === "SQL" || userContext.apiType === "Tables" || userContext.apiType === "Gremlin") && ( + + +
Retry Settings
+
+ +
+
+ Retry policy associated with throttled requests during CosmosDB queries. +
+
+ Max retry attempts + + Max number of retries to be performed for a request. Default value 9. + +
+ setRetryAttempts(parseInt(newValue) + 1 || retryAttempts)} + onDecrement={(newValue) => setRetryAttempts(parseInt(newValue) - 1 || retryAttempts)} + onValidate={(newValue) => setRetryAttempts(parseInt(newValue) || retryAttempts)} + styles={spinButtonStyles} + /> +
+ Fixed retry interval (ms) + + Fixed retry interval in milliseconds to wait between each retry ignoring the retryAfter returned + as part of the response. Default value is 0 milliseconds. + +
+ setRetryInterval(parseInt(newValue) + 1000 || retryInterval)} + onDecrement={(newValue) => setRetryInterval(parseInt(newValue) - 1000 || retryInterval)} + onValidate={(newValue) => setRetryInterval(parseInt(newValue) || retryInterval)} + styles={spinButtonStyles} + /> +
+ Max wait time (s) + + Max wait time in seconds to wait for a request while the retries are happening. Default value 30 + seconds. + +
+ setMaxWaitTimeInSeconds(parseInt(newValue) + 1 || MaxWaitTimeInSeconds)} + onDecrement={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) - 1 || MaxWaitTimeInSeconds)} + onValidate={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) || MaxWaitTimeInSeconds)} + styles={spinButtonStyles} + />
-
- Max retry attempts - - Max number of retries to be performed for a request. Default value 9. - -
- setRetryAttempts(parseInt(newValue) + 1 || retryAttempts)} - onDecrement={(newValue) => setRetryAttempts(parseInt(newValue) - 1 || retryAttempts)} - onValidate={(newValue) => setRetryAttempts(parseInt(newValue) || retryAttempts)} - styles={spinButtonStyles} - /> -
- Fixed retry interval (ms) - - Fixed retry interval in milliseconds to wait between each retry ignoring the retryAfter returned as - part of the response. Default value is 0 milliseconds. - -
- setRetryInterval(parseInt(newValue) + 1000 || retryInterval)} - onDecrement={(newValue) => setRetryInterval(parseInt(newValue) - 1000 || retryInterval)} - onValidate={(newValue) => setRetryInterval(parseInt(newValue) || retryInterval)} - styles={spinButtonStyles} - /> -
- Max wait time (s) - - Max wait time in seconds to wait for a request while the retries are happening. Default value 30 - seconds. - -
- setMaxWaitTimeInSeconds(parseInt(newValue) + 1 || MaxWaitTimeInSeconds)} - onDecrement={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) - 1 || MaxWaitTimeInSeconds)} - onValidate={(newValue) => setMaxWaitTimeInSeconds(parseInt(newValue) || MaxWaitTimeInSeconds)} - styles={spinButtonStyles} - /> -
- - + + + )} @@ -758,7 +767,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({
- {shouldShowCrossPartitionOption && ( @@ -784,7 +792,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ )} - {shouldShowParallelismOption && ( @@ -818,7 +825,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ )} - {shouldShowPriorityLevelOption && ( @@ -842,7 +848,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ )} - {shouldShowGraphAutoVizOption && ( @@ -864,7 +869,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ )} - {shouldShowCopilotSampleDBOption && ( diff --git a/src/UserContext.ts b/src/UserContext.ts index 955452d3a..d30951780 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -104,7 +104,7 @@ export interface UserContext { readonly vcoreMongoConnectionParams?: VCoreMongoConnectionParams; readonly feedbackPolicies?: AdminFeedbackPolicySettings; readonly dataPlaneRbacEnabled?: boolean; - readonly hasDataPlaneRbacSettingChanged?: boolean; + readonly refreshCosmosClient?: boolean; } export type ApiType = "SQL" | "Mongo" | "Gremlin" | "Tables" | "Cassandra" | "Postgres" | "VCoreMongo"; From 2fdb3df4ae0e59a83c2b71fdea060b9ce440dced Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:32:12 -0800 Subject: [PATCH 3/8] Update to Nuget setup action v2. (#2024) --- .github/workflows/ci.yml | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e285f87d1..5f38ef82e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} steps: - - uses: nuget/setup-nuget@v1 + - uses: nuget/setup-nuget@v2 with: nuget-api-key: ${{ secrets.NUGET_API_KEY }} - name: Download Dist Folder @@ -137,7 +137,7 @@ jobs: NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} steps: - - uses: nuget/setup-nuget@v1 + - uses: nuget/setup-nuget@v2 with: nuget-api-key: ${{ secrets.NUGET_API_KEY }} - name: Download Dist Folder @@ -185,9 +185,9 @@ jobs: if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: blob-report-${{ matrix.shardIndex }} - path: blob-report - retention-days: 1 + name: blob-report-${{ matrix.shardIndex }} + path: blob-report + retention-days: 1 merge-playwright-reports: name: "Merge Playwright Reports" @@ -197,26 +197,26 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Install dependencies - run: npm ci + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Install dependencies + run: npm ci - - name: Download blob reports from GitHub Actions Artifacts - uses: actions/download-artifact@v4 - with: - path: all-blob-reports - pattern: blob-report-* - merge-multiple: true + - name: Download blob reports from GitHub Actions Artifacts + uses: actions/download-artifact@v4 + with: + path: all-blob-reports + pattern: blob-report-* + merge-multiple: true - - name: Merge into HTML Report - run: npx playwright merge-reports --reporter html ./all-blob-reports + - name: Merge into HTML Report + run: npx playwright merge-reports --reporter html ./all-blob-reports - - name: Upload HTML report - uses: actions/upload-artifact@v4 - with: - name: html-report--attempt-${{ github.run_attempt }} - path: playwright-report - retention-days: 14 \ No newline at end of file + - name: Upload HTML report + uses: actions/upload-artifact@v4 + with: + name: html-report--attempt-${{ github.run_attempt }} + path: playwright-report + retention-days: 14 From 96faf92c12c833b2244569f8a6a977fdb41bcca2 Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:37:30 -0800 Subject: [PATCH 4/8] Use dotnet CLI for nuget operations in CI pipeline (#2026) * Start of moving nuget actions to use dotnet. * Comment out env section * Set auth token. * Disable globalization support. * Comment out dotnet setup. * Copy proj file with build. * PLace Content item under ItemGroup. * Update project with Sdk and No Build args. * Remove no-build from cmd line. * Set TargetFramework version. * Fix TargetFramework value. * Add nuget push command. * Fix test version string * Add nuget add source step. * Fix add source args. * Enable cleartext password, remove source after completion. * Use wildcard for nupkg path. Add debug. * Remove debug. * Fix nupkg path * Fix API key argument * Re-enable MPAC nuget. Tidy up ci.yml. * Fix formatting of webpack config. * Remove Globalization flag. * Revert test changes. --- .github/workflows/ci.yml | 25 +++++++++++-------------- DataExplorer.proj | 9 +++++++++ webpack.config.js | 7 ++++++- 3 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 DataExplorer.proj diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f38ef82e..1924e7e61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,21 +113,20 @@ jobs: NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} steps: - - uses: nuget/setup-nuget@v2 - with: - nuget-api-key: ${{ secrets.NUGET_API_KEY }} - name: Download Dist Folder uses: actions/download-artifact@v4 with: name: dist - run: cp ./configs/prod.json config.json - - run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "jawelton@microsoft.com" -Password "$AZURE_DEVOPS_PAT" - - run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}" - - run: nuget push -SkipDuplicate -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg + - run: dotnet nuget add source "$NUGET_SOURCE" --name "ADO" --username "jawelton@microsoft.com" --password "$AZURE_DEVOPS_PAT" --store-password-in-clear-text + - run: dotnet pack DataExplorer.proj /p:PackageVersion="2.0.0-github-${GITHUB_SHA}" + - run: dotnet nuget push "bin/Release/*.nupkg" --skip-duplicate --api-key Az --source="$NUGET_SOURCE" + - run: dotnet nuget remove source "ADO" - uses: actions/upload-artifact@v4 name: packages with: - path: "*.nupkg" + path: "bin/Release/*.nupkg" + nugetmpac: name: Publish Nuget MPAC if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/') @@ -137,22 +136,20 @@ jobs: NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} steps: - - uses: nuget/setup-nuget@v2 - with: - nuget-api-key: ${{ secrets.NUGET_API_KEY }} - name: Download Dist Folder uses: actions/download-artifact@v4 with: name: dist - run: cp ./configs/mpac.json config.json - run: sed -i 's/Azure.Cosmos.DB.Data.Explorer/Azure.Cosmos.DB.Data.Explorer.MPAC/g' DataExplorer.nuspec - - run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "jawelton@microsoft.com" -Password "$AZURE_DEVOPS_PAT" - - run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}" - - run: nuget push -SkipDuplicate -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg + - run: dotnet nuget add source "$NUGET_SOURCE" --name "ADO" --username "jawelton@microsoft.com" --password "$AZURE_DEVOPS_PAT" --store-password-in-clear-text + - run: dotnet pack DataExplorer.proj /p:PackageVersion="2.0.0-github-${GITHUB_SHA}" + - run: dotnet nuget push "bin/Release/*.nupkg" --skip-duplicate --api-key Az --source="$NUGET_SOURCE" + - run: dotnet nuget remove source "ADO" - uses: actions/upload-artifact@v4 name: packages with: - path: "*.nupkg" + path: "bin/Release/*.nupkg" playwright-tests: name: "Run Playwright Tests (Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }})" diff --git a/DataExplorer.proj b/DataExplorer.proj new file mode 100644 index 000000000..aa18a3e83 --- /dev/null +++ b/DataExplorer.proj @@ -0,0 +1,9 @@ + + + net8.0 + true + false + DataExplorer.nuspec + version=$(PackageVersion) + + \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index c21baf3ef..f594602d4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -187,7 +187,12 @@ module.exports = function (_env = {}, argv = {}) { }), new MonacoWebpackPlugin(), new CopyWebpackPlugin({ - patterns: [{ from: "DataExplorer.nuspec" }, { from: "web.config" }, { from: "quickstart/*.zip" }], + patterns: [ + { from: "DataExplorer.nuspec" }, + { from: "DataExplorer.proj" }, + { from: "web.config" }, + { from: "quickstart/*.zip" }, + ], }), new EnvironmentPlugin(envVars), ]; From eceee3691300ee778f9d3e8428397897b1a9d337 Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Tue, 21 Jan 2025 07:07:18 -0800 Subject: [PATCH 5/8] Use azure identity package for e2e test credentials (#2032) * Update identity package, remove ms-rest-nodeauth package. * Test changes to use identity package. --- package-lock.json | 516 ++++++++------------------------- package.json | 3 +- test/fx.ts | 10 +- test/sql/resourceToken.spec.ts | 2 +- test/testData.ts | 2 +- 5 files changed, 121 insertions(+), 412 deletions(-) diff --git a/package-lock.json b/package-lock.json index 30e5adc90..97106a145 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,7 @@ "@azure/arm-cosmosdb": "9.1.0", "@azure/cosmos": "4.2.0-beta.1", "@azure/cosmos-language-service": "0.0.5", - "@azure/identity": "1.5.2", - "@azure/ms-rest-nodeauth": "3.1.1", + "@azure/identity": "4.5.0", "@azure/msal-browser": "2.14.2", "@babel/plugin-proposal-class-properties": "7.12.1", "@babel/plugin-proposal-decorators": "7.12.12", @@ -428,47 +427,68 @@ "license": "0BSD" }, "node_modules/@azure/identity": { - "version": "1.5.2", - "license": "MIT", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.5.0.tgz", + "integrity": "sha512-EknvVmtBuSIic47xkOqyNabAme0RYTw52BTMz8eBgU1ysTyMrD1uOoM+JdS0J/4Yfp98IBT3osqq3BfwSaNaGQ==", "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.0.0", - "@azure/core-rest-pipeline": "^1.1.0", - "@azure/core-tracing": "1.0.0-preview.12", + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.9.0", + "@azure/core-client": "^1.9.2", + "@azure/core-rest-pipeline": "^1.17.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.11.0", "@azure/logger": "^1.0.0", - "@azure/msal-node": "1.0.0-beta.6", - "@types/stoppable": "^1.1.0", - "axios": "^0.21.1", + "@azure/msal-browser": "^3.26.1", + "@azure/msal-node": "^2.15.0", "events": "^3.0.0", "jws": "^4.0.0", - "msal": "^1.0.2", - "open": "^7.0.0", - "qs": "^6.7.0", + "open": "^8.0.0", "stoppable": "^1.1.0", - "tslib": "^2.0.0", - "uuid": "^8.3.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "optionalDependencies": { - "keytar": "^7.3.0" - } - }, - "node_modules/@azure/identity/node_modules/@azure/core-tracing": { - "version": "1.0.0-preview.12", - "license": "MIT", - "dependencies": { - "@opentelemetry/api": "^1.0.0", "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@azure/identity/node_modules/@azure/msal-browser": { + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.28.1.tgz", + "integrity": "sha512-OHHEWMB5+Zrix8yKvLVzU3rKDFvh7SOzAzXfICD7YgUXLxfHpTPX2pzOotrri1kskwhHqIj4a5LvhZlIqE7C7g==", + "dependencies": { + "@azure/msal-common": "14.16.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/identity/node_modules/@azure/msal-common": { + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/identity/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@azure/identity/node_modules/tslib": { - "version": "2.6.2", - "license": "0BSD" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/@azure/logger": { "version": "1.0.4", @@ -484,10 +504,6 @@ "version": "2.6.2", "license": "0BSD" }, - "node_modules/@azure/ms-rest-azure-env": { - "version": "2.0.0", - "license": "MIT" - }, "node_modules/@azure/ms-rest-azure-js": { "version": "2.1.0", "license": "MIT", @@ -559,15 +575,6 @@ "node": ">=4.0" } }, - "node_modules/@azure/ms-rest-nodeauth": { - "version": "3.1.1", - "license": "MIT", - "dependencies": { - "@azure/ms-rest-azure-env": "^2.0.0", - "@azure/ms-rest-js": "^2.0.4", - "adal-node": "^0.2.2" - } - }, "node_modules/@azure/msal-browser": { "version": "2.14.2", "license": "MIT", @@ -589,13 +596,24 @@ } }, "node_modules/@azure/msal-node": { - "version": "1.0.0-beta.6", - "license": "MIT", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz", + "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==", "dependencies": { - "@azure/msal-common": "^4.0.0", - "axios": "^0.21.1", - "jsonwebtoken": "^8.5.1", + "@azure/msal-common": "14.16.0", + "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@azure/msal-node/node_modules/@azure/msal-common": { + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", + "engines": { + "node": ">=0.8.0" } }, "node_modules/@babel/code-frame": { @@ -10073,13 +10091,6 @@ "@octokit/openapi-types": "^19.0.2" } }, - "node_modules/@opentelemetry/api": { - "version": "1.8.0", - "license": "Apache-2.0", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/@phosphor/algorithm": { "version": "1.2.0", "license": "BSD-3-Clause" @@ -12725,13 +12736,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/@types/stoppable": { - "version": "1.1.3", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/styled-components": { "version": "5.1.1", "dev": true, @@ -13334,61 +13338,6 @@ "node": ">=0.4.0" } }, - "node_modules/adal-node": { - "version": "0.2.4", - "license": "Apache-2.0", - "dependencies": { - "@xmldom/xmldom": "^0.8.3", - "async": "^2.6.3", - "axios": "^0.21.1", - "date-utils": "*", - "jws": "3.x.x", - "underscore": ">= 1.3.1", - "uuid": "^3.1.0", - "xpath.js": "~1.1.0" - }, - "engines": { - "node": ">= 0.6.15" - } - }, - "node_modules/adal-node/node_modules/@xmldom/xmldom": { - "version": "0.8.10", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/adal-node/node_modules/async": { - "version": "2.6.4", - "license": "MIT", - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/adal-node/node_modules/jwa": { - "version": "1.4.1", - "license": "MIT", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/adal-node/node_modules/jws": { - "version": "3.2.2", - "license": "MIT", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/adal-node/node_modules/uuid": { - "version": "3.4.0", - "license": "MIT", - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/address": { "version": "1.1.2", "dev": true, @@ -14021,13 +13970,6 @@ "version": "1.12.0", "license": "MIT" }, - "node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/babel-core": { "version": "7.0.0-bridge.0", "dev": true, @@ -14731,7 +14673,7 @@ }, "node_modules/base64-js": { "version": "1.5.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -14803,8 +14745,9 @@ }, "node_modules/bl": { "version": "4.1.0", - "devOptional": true, + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -14813,7 +14756,7 @@ }, "node_modules/bl/node_modules/buffer": { "version": "5.7.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -14829,6 +14772,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -14836,8 +14780,9 @@ }, "node_modules/bl/node_modules/readable-stream": { "version": "3.6.2", - "devOptional": true, + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -15407,11 +15352,6 @@ "node": ">=8.0" } }, - "node_modules/chownr": { - "version": "1.1.4", - "license": "ISC", - "optional": true - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "license": "MIT", @@ -17175,13 +17115,6 @@ "version": "1.29.0", "license": "MIT" }, - "node_modules/date-utils": { - "version": "1.2.21", - "license": "MIT", - "engines": { - "node": ">0.4.0" - } - }, "node_modules/dayjs": { "version": "1.8.19", "license": "MIT" @@ -17276,14 +17209,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "license": "MIT" @@ -17344,7 +17269,6 @@ }, "node_modules/define-lazy-prop": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -18976,14 +18900,6 @@ "version": "2.0.0", "license": "MIT" }, - "node_modules/expand-template": { - "version": "2.0.3", - "license": "(MIT OR WTFPL)", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/expect": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", @@ -19671,6 +19587,7 @@ }, "node_modules/follow-redirects": { "version": "1.15.3", + "dev": true, "funding": [ { "type": "individual", @@ -19978,11 +19895,6 @@ "node": ">= 0.6" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/fs-extra": { "version": "7.0.0", "dev": true, @@ -20197,11 +20109,6 @@ "assert-plus": "^1.0.0" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "license": "MIT", - "optional": true - }, "node_modules/glob": { "version": "7.2.3", "license": "ISC", @@ -21333,7 +21240,7 @@ }, "node_modules/ieee754": { "version": "1.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -21522,7 +21429,7 @@ }, "node_modules/ini": { "version": "1.3.8", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/internal-slot": { @@ -27558,8 +27465,9 @@ } }, "node_modules/jsonwebtoken": { - "version": "8.5.1", - "license": "MIT", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -27570,16 +27478,17 @@ "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", "ms": "^2.1.1", - "semver": "^5.6.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=4", - "npm": ">=1.4.28" + "node": ">=12", + "npm": ">=6" } }, "node_modules/jsonwebtoken/node_modules/jwa": { "version": "1.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -27588,12 +27497,24 @@ }, "node_modules/jsonwebtoken/node_modules/jws": { "version": "3.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jsprim": { "version": "1.4.2", "license": "MIT", @@ -27646,16 +27567,6 @@ "version": "2.6.0", "license": "MIT" }, - "node_modules/keytar": { - "version": "7.9.0", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "node-addon-api": "^4.3.0", - "prebuild-install": "^7.0.1" - } - }, "node_modules/keyv": { "version": "4.5.4", "license": "MIT", @@ -27972,7 +27883,8 @@ }, "node_modules/lodash.includes": { "version": "4.3.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" }, "node_modules/lodash.invokemap": { "version": "4.6.0", @@ -27981,7 +27893,8 @@ }, "node_modules/lodash.isboolean": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" }, "node_modules/lodash.isequal": { "version": "4.5.0", @@ -27989,19 +27902,23 @@ }, "node_modules/lodash.isinteger": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" }, "node_modules/lodash.isnumber": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, "node_modules/lodash.isstring": { "version": "4.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -28013,7 +27930,8 @@ }, "node_modules/lodash.once": { "version": "4.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" }, "node_modules/lodash.pullall": { "version": "4.2.0", @@ -29526,11 +29444,6 @@ "node": ">=10" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "license": "MIT", - "optional": true - }, "node_modules/moment": { "version": "2.29.4", "license": "MIT", @@ -29597,16 +29510,6 @@ "version": "2.1.3", "license": "MIT" }, - "node_modules/msal": { - "version": "1.4.18", - "license": "MIT", - "dependencies": { - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/multicast-dns": { "version": "7.2.5", "dev": true, @@ -29667,11 +29570,6 @@ "node": ">=0.10.0" } }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "license": "MIT", - "optional": true - }, "node_modules/native-promise-only": { "version": "0.8.1", "dev": true, @@ -29756,58 +29654,12 @@ "node": ">=12.0.0" } }, - "node_modules/node-abi": { - "version": "3.60.0", - "license": "MIT", - "optional": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/semver": { - "version": "7.6.0", - "license": "ISC", - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC", - "optional": true - }, "node_modules/node-abort-controller": { "version": "3.1.1", "dev": true, "license": "MIT", "peer": true }, - "node_modules/node-addon-api": { - "version": "4.3.0", - "license": "MIT", - "optional": true - }, "node_modules/node-dir": { "version": "0.1.17", "dev": true, @@ -31006,80 +30858,6 @@ "version": "4.2.0", "license": "MIT" }, - "node_modules/prebuild-install": { - "version": "7.1.2", - "license": "MIT", - "optional": true, - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prebuild-install/node_modules/decompress-response": { - "version": "6.0.0", - "license": "MIT", - "optional": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/prebuild-install/node_modules/mimic-response": { - "version": "3.1.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/prebuild-install/node_modules/simple-get": { - "version": "4.0.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "license": "MIT", @@ -31509,28 +31287,6 @@ "version": "0.5.1", "dev": true }, - "node_modules/rc": { - "version": "1.2.8", - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "optional": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/re-resizable": { "version": "6.9.11", "license": "MIT", @@ -34439,45 +34195,6 @@ "node": ">=10" } }, - "node_modules/tar-fs": { - "version": "2.1.1", - "license": "MIT", - "optional": true, - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "license": "MIT", - "optional": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.2", - "license": "MIT", - "optional": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/tar/node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -36815,13 +36532,6 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "node_modules/xpath.js": { - "version": "1.1.0", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/xtend": { "version": "4.0.2", "license": "MIT", diff --git a/package.json b/package.json index 16e80c5e5..2b984ca47 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "@azure/arm-cosmosdb": "9.1.0", "@azure/cosmos": "4.2.0-beta.1", "@azure/cosmos-language-service": "0.0.5", - "@azure/identity": "1.5.2", - "@azure/ms-rest-nodeauth": "3.1.1", + "@azure/identity": "4.5.0", "@azure/msal-browser": "2.14.2", "@babel/plugin-proposal-class-properties": "7.12.1", "@babel/plugin-proposal-decorators": "7.12.12", diff --git a/test/fx.ts b/test/fx.ts index b44028dc8..661d55897 100644 --- a/test/fx.ts +++ b/test/fx.ts @@ -1,4 +1,4 @@ -import { AzureCliCredentials } from "@azure/ms-rest-nodeauth"; +import { AzureCliCredential } from "@azure/identity"; import { expect, Frame, Locator, Page } from "@playwright/test"; import crypto from "crypto"; @@ -20,13 +20,13 @@ export function generateUniqueName(baseName, options?: TestNameOptions): string return `${prefix}${baseName}${crypto.randomBytes(length).toString("hex")}${suffix}`; } -export async function getAzureCLICredentials(): Promise { - return await AzureCliCredentials.create(); +export function getAzureCLICredentials(): AzureCliCredential { + return new AzureCliCredential(); } export async function getAzureCLICredentialsToken(): Promise { - const credentials = await getAzureCLICredentials(); - const token = (await credentials.getToken()).accessToken; + const credentials = getAzureCLICredentials(); + const token = (await credentials.getToken("https://management.core.windows.net//.default")).token; return token; } diff --git a/test/sql/resourceToken.spec.ts b/test/sql/resourceToken.spec.ts index f274ce85c..1fc75a58b 100644 --- a/test/sql/resourceToken.spec.ts +++ b/test/sql/resourceToken.spec.ts @@ -13,7 +13,7 @@ import { } from "../fx"; test("SQL account using Resource token", async ({ page }) => { - const credentials = await getAzureCLICredentials(); + const credentials = getAzureCLICredentials(); const armClient = new CosmosDBManagementClient(credentials, subscriptionId); const accountName = getAccountName(TestAccount.SQL); const account = await armClient.databaseAccounts.get(resourceGroupName, accountName); diff --git a/test/testData.ts b/test/testData.ts index cf8ca6f20..543796894 100644 --- a/test/testData.ts +++ b/test/testData.ts @@ -56,7 +56,7 @@ export class TestContainerContext { export async function createTestSQLContainer(includeTestData?: boolean) { const databaseId = generateUniqueName("db"); const containerId = "testcontainer"; // A unique container name isn't needed because the database is unique - const credentials = await getAzureCLICredentials(); + const credentials = getAzureCLICredentials(); const armClient = new CosmosDBManagementClient(credentials, subscriptionId); const accountName = getAccountName(TestAccount.SQL); const account = await armClient.databaseAccounts.get(resourceGroupName, accountName); From 2a81551a60bf2a86a9bb8a32af22158ef65c96fa Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Tue, 21 Jan 2025 07:07:53 -0800 Subject: [PATCH 6/8] Use unique names in upload artifacts tasks (#2030) * Specify actual package names in upload artifacts task. * Revert path change, use unique names for upload task. * Fix the right properties. * Revert condition change --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1924e7e61..3fc062bfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,9 @@ jobs: - run: dotnet nuget push "bin/Release/*.nupkg" --skip-duplicate --api-key Az --source="$NUGET_SOURCE" - run: dotnet nuget remove source "ADO" - uses: actions/upload-artifact@v4 - name: packages + name: Upload package to Artifacts with: + name: prod-package path: "bin/Release/*.nupkg" nugetmpac: @@ -147,8 +148,9 @@ jobs: - run: dotnet nuget push "bin/Release/*.nupkg" --skip-duplicate --api-key Az --source="$NUGET_SOURCE" - run: dotnet nuget remove source "ADO" - uses: actions/upload-artifact@v4 - name: packages + name: Upload package to Artifacts with: + name: mpac-package path: "bin/Release/*.nupkg" playwright-tests: From 1d952a4ea2e57ee0ce95dde945afc8162ebd3370 Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:53:47 -0800 Subject: [PATCH 7/8] Remove throughput survey text and link from Throughput tab. (#2031) --- .../ThroughputInputAutoPilotV3Component.tsx | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputInputAutoPilotV3Component.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputInputAutoPilotV3Component.tsx index 664ae01c7..391789938 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputInputAutoPilotV3Component.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputInputAutoPilotV3Component.tsx @@ -17,14 +17,13 @@ import { } from "@fluentui/react"; import React from "react"; import * as DataModels from "../../../../../Contracts/DataModels"; -import { SubscriptionType } from "../../../../../Contracts/SubscriptionType"; import * as SharedConstants from "../../../../../Shared/Constants"; import { Action, ActionModifiers } from "../../../../../Shared/Telemetry/TelemetryConstants"; import * as TelemetryProcessor from "../../../../../Shared/Telemetry/TelemetryProcessor"; import { userContext } from "../../../../../UserContext"; import * as AutoPilotUtils from "../../../../../Utils/AutoPilotUtils"; import { autoPilotThroughput1K } from "../../../../../Utils/AutoPilotUtils"; -import { calculateEstimateNumber, usageInGB } from "../../../../../Utils/PricingUtils"; +import { calculateEstimateNumber } from "../../../../../Utils/PricingUtils"; import { Int32 } from "../../../../Panes/Tables/Validators/EntityPropertyValidationCommon"; import { PriceBreakdown, @@ -366,29 +365,6 @@ export class ThroughputInputAutoPilotV3Component extends React.Component< }); }; - private minRUperGBSurvey = (): JSX.Element => { - const href = `https://ncv.microsoft.com/vRBTO37jmO?ctx={"AzureSubscriptionId":"${userContext.subscriptionId}","CosmosDBAccountName":"${userContext.databaseAccount?.name}"}`; - const oneTBinKB = 1000000000; - const minRUperGB = 10; - const featureFlagEnabled = userContext.features.showMinRUSurvey; - const collectionIsEligible = - userContext.subscriptionType !== SubscriptionType.Internal && - this.props.usageSizeInKB > oneTBinKB && - this.props.minimum >= usageInGB(this.props.usageSizeInKB) * minRUperGB; - if (featureFlagEnabled || collectionIsEligible) { - return ( - - Need to scale below {this.props.minimum} RU/s? Reach out by filling{" "} - - this questionnaire - - . - - ); - } - return undefined; - }; - private renderThroughputModeChoices = (): JSX.Element => { const labelId = "settingsV2RadioButtonLabelId"; return ( @@ -661,7 +637,6 @@ export class ThroughputInputAutoPilotV3Component extends React.Component< )} - {this.minRUperGBSurvey()} {this.props.spendAckVisible && ( Date: Fri, 24 Jan 2025 07:23:33 -0800 Subject: [PATCH 8/8] Remove hard coded client and subscription Ids from webpack config. (#2033) --- webpack.config.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index f594602d4..859affc44 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,9 +20,7 @@ const isCI = require("is-ci"); const gitSha = childProcess.execSync("git rev-parse HEAD").toString("utf8"); -const AZURE_CLIENT_ID = "fd8753b0-0707-4e32-84e9-2532af865fb4"; const AZURE_TENANT_ID = "72f988bf-86f1-41af-91ab-2d7cd011db47"; -const SUBSCRIPTION_ID = "69e02f2d-f059-4409-9eac-97e8a276ae2c"; const RESOURCE_GROUP = "de-e2e-tests"; const AZURE_CLIENT_SECRET = process.env.AZURE_CLIENT_SECRET || process.env.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET; // TODO Remove. Exists for backwards compat with old .env files. Prefer AZURE_CLIENT_SECRET @@ -96,10 +94,7 @@ module.exports = function (_env = {}, argv = {}) { if (mode === "development") { envVars.NODE_ENV = "development"; - envVars.AZURE_CLIENT_ID = AZURE_CLIENT_ID; - envVars.AZURE_TENANT_ID = AZURE_TENANT_ID; envVars.AZURE_CLIENT_SECRET = AZURE_CLIENT_SECRET || null; - envVars.SUBSCRIPTION_ID = SUBSCRIPTION_ID; envVars.RESOURCE_GROUP = RESOURCE_GROUP; typescriptRule.use[0].options.compilerOptions = { target: "ES2018" }; }