From 7fcd56e247e1d1db1cb3c80e21ccf50d3ed8d035 Mon Sep 17 00:00:00 2001 From: Jade Welton Date: Fri, 17 Jul 2026 10:49:13 -0700 Subject: [PATCH] Preview site and storage changes. Cleanup script changes. --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- .github/workflows/cleanup.yml | 2 ++ preview/index.js | 2 +- utils/cleanupDBs.js | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4564abac5..ceb0bc8fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,13 +101,13 @@ jobs: - name: "Az CLI login" uses: azure/login@v1 with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.PREVIEW_SUBSCRIPTION_ID }} + client-id: ${{ secrets.E2ETESTS_CLIENT_ID }} + tenant-id: ${{ secrets.E2ETESTS_TENANT_ID }} + subscription-id: ${{ secrets.E2ETESTS_SUBSCRIPTION_ID }} - name: Upload build to preview blob storage - run: az storage blob upload-batch -d '$web' -s 'dist' --account-name ${{ secrets.PREVIEW_STORAGE_ACCOUNT_NAME }} --destination-path "${{github.event.pull_request.head.sha || github.sha}}" --auth-mode login --overwrite true + run: az storage blob upload-batch -d '$web' -s 'dist' --account-name ${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} --destination-path "${{github.event.pull_request.head.sha || github.sha}}" --auth-mode login --overwrite true - name: Upload preview config to blob storage - run: az storage blob upload -c '$web' -f ./preview/config.json --account-name ${{ secrets.PREVIEW_STORAGE_ACCOUNT_NAME }} --name "${{github.event.pull_request.head.sha || github.sha}}/config.json" --auth-mode login --overwrite true + run: az storage blob upload -c '$web' -f ./preview/config.json --account-name ${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} --name "${{github.event.pull_request.head.sha || github.sha}}/config.json" --auth-mode login --overwrite true nuget: name: Publish Nuget if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/') @@ -233,9 +233,9 @@ jobs: if: ${{ !cancelled() }} uses: Azure/login@v2 with: - client-id: ${{ secrets.E2E_TESTS_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + client-id: ${{ secrets.E2ETESTS_CLIENT_ID }} + tenant-id: ${{ secrets.E2ETESTS_TENANT_ID }} + subscription-id: ${{ secrets.E2ETESTS_SUBSCRIPTION_ID }} - name: Upload shard blob-report to Azure Storage if: ${{ !cancelled() }} env: @@ -243,7 +243,7 @@ jobs: SHARD: ${{ matrix.shardIndex }} run: | az storage blob upload-batch \ - --account-name ${{ secrets.PREVIEW_STORAGE_ACCOUNT_NAME }} \ + --account-name ${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} \ --auth-mode login \ -d playwright-reports \ -s blob-report \ @@ -272,9 +272,9 @@ jobs: - name: "Az CLI login" uses: Azure/login@v2 with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.PREVIEW_SUBSCRIPTION_ID }} + client-id: ${{ secrets.E2ETESTS_CLIENT_ID }} + tenant-id: ${{ secrets.E2ETESTS_TENANT_ID }} + subscription-id: ${{ secrets.E2ETESTS_SUBSCRIPTION_ID }} - name: Download all shard reports from Azure Storage env: @@ -282,7 +282,7 @@ jobs: run: | mkdir -p all-blob-reports az storage blob download-batch \ - --account-name ${{ secrets.PREVIEW_STORAGE_ACCOUNT_NAME }} \ + --account-name ${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} \ --auth-mode login \ -s playwright-reports \ --pattern "${KEY}/shards/*" \ @@ -305,7 +305,7 @@ jobs: KEY: ${{ github.run_id }}-${{ github.run_attempt }} run: | az storage blob upload \ - --account-name ${{ secrets.PREVIEW_STORAGE_ACCOUNT_NAME }} \ + --account-name ${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} \ --auth-mode login \ -c playwright-reports \ -n "${KEY}/report.zip" \ @@ -318,7 +318,7 @@ jobs: KEY: ${{ github.run_id }}-${{ github.run_attempt }} run: | az storage blob delete-batch \ - --account-name ${{ secrets.PREVIEW_STORAGE_ACCOUNT_NAME }} \ + --account-name ${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} \ --auth-mode login \ -s playwright-reports \ --pattern "${KEY}/shards/*" @@ -328,7 +328,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR: ${{ github.event.pull_request.number }} - SA_ID: /subscriptions/${{ secrets.PREVIEW_SUBSCRIPTION_ID }}/resourceGroups/dataexplorer-preview/providers/Microsoft.Storage/storageAccounts/dataexplorerpreview + SA_ID: /subscriptions/${{ secrets.E2ETESTS_SUBSCRIPTION_ID }}/resourceGroups/dataexplorer-preview/providers/Microsoft.Storage/storageAccounts/${{ secrets.E2ETESTS_STORAGEACCOUNT_NAME }} KEY: ${{ github.run_id }}-${{ github.run_attempt }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} run: | diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 871da4406..b2d3471af 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -23,6 +23,8 @@ jobs: AZURE_SUBSCRIPTION_ID: ${{ secrets.E2ETESTS_SUBSCRIPTION_ID }} steps: - uses: actions/checkout@v4 + env: + E2ETESTS_RESOURCEGROUP_NAME : ${{ secrets.E2ETESTS_RESOURCEGROUP_NAME }} - name: "Az CLI login" uses: azure/login@v2 diff --git a/preview/index.js b/preview/index.js index 1320e3cb2..5567dd5cf 100644 --- a/preview/index.js +++ b/preview/index.js @@ -5,7 +5,7 @@ const fetch = require("node-fetch"); const backendEndpoint = "https://cdb-ms-mpac-pbe.cosmos.azure.com"; const previewSiteEndpoint = "https://dataexplorer-preview.azurewebsites.net"; -const previewStorageWebsiteEndpoint = "https://dataexplorerpreview.z5.web.core.windows.net/"; +const previewStorageWebsiteEndpoint = "_REPLACE_STORAGE_WEBSITE_ENDPOINT_"; const githubApiUrl = "https://api.github.com/repos/Azure/cosmos-explorer"; const azurePortalMpacEndpoint = "https://ms.portal.azure.com/"; diff --git a/utils/cleanupDBs.js b/utils/cleanupDBs.js index 0c19973a3..233743c0f 100644 --- a/utils/cleanupDBs.js +++ b/utils/cleanupDBs.js @@ -3,7 +3,7 @@ const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const ms = require("ms"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -const resourceGroupName = "de-e2e-tests"; +const resourceGroupName = process.env["E2ETESTS_RESOURCEGROUP_NAME"]; const thirtyMinutesAgo = new Date(Date.now() - 1000 * 60 * 30).getTime();