From 7afa566b954887c3104fae274af43caa10000ba7 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 6 Dec 2024 18:46:30 +0000 Subject: [PATCH] [@typespec/http-specs] Add Installation Scripts to typespec repository (#5278) This is one of the required steps to get the dashboards released. Please review and approve the PR. Thanks --- .../changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md | 8 ++++++++ package.json | 6 +++++- packages/http-specs/CHANGELOG.md | 4 ++++ packages/http-specs/package.json | 4 +++- packages/spector/src/actions/upload-coverage-report.ts | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md diff --git a/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md b/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md new file mode 100644 index 0000000000..e3e74262ca --- /dev/null +++ b/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md @@ -0,0 +1,8 @@ +--- +changeKind: internal +packages: + - "@typespec/http-specs" + - "@typespec/spector" +--- + +Adding scripts to package.json \ No newline at end of file diff --git a/package.json b/package.json index 786d4a21ec..adb2207254 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,11 @@ "test:e2e": "pnpm -r run test:e2e", "update-latest-docs": "pnpm -r run update-latest-docs", "watch": "tsc --build ./tsconfig.ws.json --watch", - "sync-labels": "tsx ./eng/common/scripts/labels/sync-labels.ts --config ./eng/common/config/labels.ts" + "sync-labels": "tsx ./eng/common/scripts/labels/sync-labels.ts --config ./eng/common/config/labels.ts", + "validate-scenarios": "pnpm -r --filter=@typespec/http-specs run validate-scenarios", + "validate-mock-apis": "pnpm -r --filter=@typespec/http-specs run validate-mock-apis", + "generate-scenarios-summary": "pnpm -r --filter=@typespec/http-specs run generate-scenarios-summary", + "upload-manifest": "pnpm -r --filter=@typespec/http-specs run upload-manifest" }, "devDependencies": { "@chronus/chronus": "^0.13.0", diff --git a/packages/http-specs/CHANGELOG.md b/packages/http-specs/CHANGELOG.md index 2bfe98d87a..a64b980f23 100644 --- a/packages/http-specs/CHANGELOG.md +++ b/packages/http-specs/CHANGELOG.md @@ -1,5 +1,9 @@ # @typespec/http-specs +## 0.1.0-alpha.3 + +- Create coverages container if not existing + ## 0.1.0-alpha.2 - Minor `api-key` in the `authentication` specs diff --git a/packages/http-specs/package.json b/packages/http-specs/package.json index 33c0d78243..18ad38dd70 100644 --- a/packages/http-specs/package.json +++ b/packages/http-specs/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-specs", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "Spec scenarios and mock apis", "main": "dist/index.js", "type": "module", @@ -12,6 +12,8 @@ "validate-scenarios": "tsp-spector validate-scenarios ./specs", "generate-scenarios-summary": "tsp-spector generate-scenarios-summary ./specs", "regen-docs": "pnpm generate-scenarios-summary", + "upload-manifest": "tsp-spector upload-manifest ./specs --setName @typespec/http-specs --containerName manifests-typespec --storageAccountName typespec", + "upload-coverage": "tsp-spector upload-coverage --generatorName @typespec/http-specs --generatorVersion 0.1.0-alpha.3 --containerName coverages --generatorMode standard --storageAccountName typespec", "validate-mock-apis": "tsp-spector validate-mock-apis ./specs", "check-scenario-coverage": "tsp-spector check-coverage ./specs", "validate-client-server": "concurrently \"tsp-spector server start ./specs\" \"npm run client\" && tsp-spector server stop", diff --git a/packages/spector/src/actions/upload-coverage-report.ts b/packages/spector/src/actions/upload-coverage-report.ts index 9f5fb38ed4..caf1b20191 100644 --- a/packages/spector/src/actions/upload-coverage-report.ts +++ b/packages/spector/src/actions/upload-coverage-report.ts @@ -30,6 +30,7 @@ export async function uploadCoverageReport({ credential: new AzureCliCredential(), containerName, }); + await client.createIfNotExists(); const generatorMetadata: GeneratorMetadata = { name: generatorName, version: generatorVersion,