devops: change flakiness-dashboard auth to be secret-less (#30488)

This commit is contained in:
Max Schmitt 2024-04-24 22:23:28 +02:00 committed by GitHub
parent 4e086e6df8
commit d5ade91a92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 831 additions and 53 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@ node_modules/
*.swp *.swp
*.pyc *.pyc
.vscode .vscode
.mono
.idea .idea
yarn.lock yarn.lock
/packages/playwright-core/src/generated /packages/playwright-core/src/generated

View file

@ -14,11 +14,11 @@ Azure Functions Core Tools is not available on macOS M1 yet, so we use GitHub Co
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list' sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'
apt-get update && apt-get install azure-functions-core-tools-4 apt-get update && apt-get install azure-functions-core-tools-4 sudo
``` ```
- Install Azure CLI: - Install Azure CLI:
```bash ```bash
curl -sL https://aka.ms/InstallAzureCLIDeb | bash curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
``` ```
- Login to Azure: - Login to Azure:
```bash ```bash

View file

@ -16,6 +16,6 @@
}, },
"extensionBundle": { "extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle", "id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)" "version": "[4.*, 5.0.0)"
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -2,11 +2,10 @@
"name": "flakiness-dashboard", "name": "flakiness-dashboard",
"version": "", "version": "",
"description": "", "description": "",
"scripts": { "main": "processing/index.js",
"test": "echo \"No tests yet...\""
},
"author": "", "author": "",
"dependencies": { "dependencies": {
"@azure/storage-blob": "^12.16.0" "@azure/identity": "^4.1.0",
"@azure/storage-blob": "^12.17.0"
} }
} }

View file

@ -1,13 +0,0 @@
{
"version": "2.0",
"extensions": {
"queues": {
"batchSize": 1,
"newBatchThreshold": 0
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}

View file

@ -13,14 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
const { BlobServiceClient } = require("@azure/storage-blob"); // @ts-check
const { DefaultAzureCredential } = require('@azure/identity');
const { BlobServiceClient } = require('@azure/storage-blob');
const defaultAzureCredential = new DefaultAzureCredential();
const zlib = require('zlib'); const zlib = require('zlib');
const util = require('util'); const util = require('util');
const gzipAsync = util.promisify(zlib.gzip); const gzipAsync = util.promisify(zlib.gzip);
const gunzipAsync = util.promisify(zlib.gunzip); const gunzipAsync = util.promisify(zlib.gunzip);
const blobServiceClient = BlobServiceClient.fromConnectionString(process.env.AzureWebJobsStorage); const AZURE_STORAGE_ACCOUNT = 'folioflakinessdashboard';
const blobServiceClient = new BlobServiceClient(
`https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net`,
defaultAzureCredential
);
function flattenSpecs(suite, result = [], titlePaths = []) { function flattenSpecs(suite, result = [], titlePaths = []) {
if (suite.suites) { if (suite.suites) {