From 91ed2c44dc33e90adf9071ebede8597905874eaf Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Fri, 1 Mar 2024 10:06:55 +0100 Subject: [PATCH] fix: release workflows [IDE-155] (#434) * fix: release workflows [IDE-155] * docs: update changelog --- .github/workflows/release-preview.yaml | 8 +------- .github/workflows/release-stable.yaml | 6 ------ CHANGELOG.md | 4 ++++ package.json | 1 - scripts/patchPreview.js | 1 - snyk.config.json | 1 - src/snyk/common/configuration/snykConfiguration.ts | 4 +--- .../common/experiment/services/experimentService.test.ts | 5 ++--- 8 files changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-preview.yaml b/.github/workflows/release-preview.yaml index 838259c03..00f12ef43 100644 --- a/.github/workflows/release-preview.yaml +++ b/.github/workflows/release-preview.yaml @@ -6,9 +6,7 @@ on: jobs: build: uses: snyk/vscode-extension/.github/workflows/ci.yaml@main - secrets: - ITERATIVELY_KEY: ${{ secrets.ITERATIVELY_KEY }} - + release-preview: name: Release Preview runs-on: ubuntu-latest @@ -24,14 +22,10 @@ jobs: - name: Install dependencies run: npm ci - - name: Verify analytics events - run: npm run ampli:verify -- -t ${{ secrets.ITERATIVELY_KEY }} - # Naming convention for the preview version means we can only release one preview per hour - name: Patch to preview version run: npm run patch-preview env: - SNYK_VSCE_SEGMENT_WRITE_KEY: ${{ secrets.SNYK_VSCE_SEGMENT_WRITE_KEY }} SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY: ${{ secrets.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY }} SNYK_VSCE_SENTRY_DSN_KEY: ${{ secrets.SNYK_VSCE_SENTRY_DSN_KEY }} diff --git a/.github/workflows/release-stable.yaml b/.github/workflows/release-stable.yaml index d6ae0d4fd..5d1f4aac1 100644 --- a/.github/workflows/release-stable.yaml +++ b/.github/workflows/release-stable.yaml @@ -8,8 +8,6 @@ on: jobs: build: uses: snyk/vscode-extension/.github/workflows/ci.yaml@main - secrets: - ITERATIVELY_KEY: ${{ secrets.ITERATIVELY_KEY }} publish: runs-on: ubuntu-latest @@ -29,9 +27,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Verify analytics events - run: npm run ampli:verify -- -t ${{ secrets.ITERATIVELY_KEY }} - - name: Bump patch version id: patched-tag uses: mathieudutour/github-tag-action@v6.0 @@ -43,7 +38,6 @@ jobs: - name: Add Credentials run: | sed -i \ - -e 's|${env.SNYK_VSCE_SEGMENT_WRITE_KEY}|${{ secrets.SNYK_VSCE_SEGMENT_WRITE_KEY }}|g' \ -e 's|${env.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY}|${{ secrets.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY }}|g' \ -e 's|${env.SNYK_VSCE_SENTRY_DSN_KEY}|${{ secrets.SNYK_VSCE_SENTRY_DSN_KEY }}|g' \ snyk.config.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a907aabe..4e1013e4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Snyk Security - Code and Open Source Dependencies Changelog +## [2.3.6 +### Changes +- Removed Amplitude telemetry and corresponding setting from VSCode + ## [2.3.5] ### Documentation diff --git a/package.json b/package.json index 55c03d78c..d4a7f4465 100644 --- a/package.json +++ b/package.json @@ -375,7 +375,6 @@ "lint": "npx eslint \"src/**/*.ts\"", "lint:fix": "npx eslint --fix \"src/**/*.ts\"", "vscode:uninstall": "node ./out/uninstall", - "ampli:verify": "ampli status -u --skip-update-on-default-branch", "patch-preview": "node ./scripts/patchPreview.js" }, "devDependencies": { diff --git a/scripts/patchPreview.js b/scripts/patchPreview.js index f8c243f78..4b763fbab 100644 --- a/scripts/patchPreview.js +++ b/scripts/patchPreview.js @@ -27,7 +27,6 @@ fs.writeFileSync('./package.json', json); let snykConfigJson = require('../snyk.config.json'); snykConfigJson = JSON.stringify({ ...snykConfigJson, - segmentWriteKey: process.env.SNYK_VSCE_SEGMENT_WRITE_KEY, amplitudeExperimentApiKey: process.env.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY, sentryKey: process.env.SNYK_VSCE_SENTRY_DSN_KEY, }); diff --git a/snyk.config.json b/snyk.config.json index 787a9ff4d..e2edd24ad 100644 --- a/snyk.config.json +++ b/snyk.config.json @@ -1,5 +1,4 @@ { - "segmentWriteKey": "${env.SNYK_VSCE_SEGMENT_WRITE_KEY}", "amplitudeExperimentApiKey": "${env.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY}", "sentryKey": "${env.SNYK_VSCE_SENTRY_DSN_KEY}" } diff --git a/src/snyk/common/configuration/snykConfiguration.ts b/src/snyk/common/configuration/snykConfiguration.ts index 635941bcd..9f4c7a8c8 100644 --- a/src/snyk/common/configuration/snykConfiguration.ts +++ b/src/snyk/common/configuration/snykConfiguration.ts @@ -4,12 +4,10 @@ export class SnykConfiguration { private static readonly configFileName = 'snyk.config.json'; private static readonly localConfigFileName = 'snyk.config.local.json'; - readonly segmentWriteKey: string; readonly amplitudeExperimentApiKey: string; readonly sentryKey: string; - constructor(segmentWriteKey: string, amplitudeExperimentApiKey: string, sentryKey: string) { - this.segmentWriteKey = segmentWriteKey; + constructor(amplitudeExperimentApiKey: string, sentryKey: string) { this.amplitudeExperimentApiKey = amplitudeExperimentApiKey; this.sentryKey = sentryKey; } diff --git a/src/test/unit/common/experiment/services/experimentService.test.ts b/src/test/unit/common/experiment/services/experimentService.test.ts index c407ca33e..dcbfab2ca 100644 --- a/src/test/unit/common/experiment/services/experimentService.test.ts +++ b/src/test/unit/common/experiment/services/experimentService.test.ts @@ -16,7 +16,6 @@ suite('ExperimentService', () => { sinon.stub(SnykConfiguration, 'get').resolves({ amplitudeExperimentApiKey: 'test', - segmentWriteKey: 'test', } as SnykConfiguration); fetchStub = sinon.stub(); @@ -57,7 +56,7 @@ suite('ExperimentService', () => { shouldReportEvents: true, } as unknown as IConfiguration; - const snykConfig = new SnykConfiguration('test', 'test', 'test'); + const snykConfig = new SnykConfiguration('test', 'test'); const service = new ExperimentService(user, new LoggerMock(), config, snykConfig); service.load(); @@ -74,7 +73,7 @@ suite('ExperimentService', () => { shouldReportEvents: true, } as unknown as IConfiguration; - const snykConfig = new SnykConfiguration('test', 'test', 'test'); + const snykConfig = new SnykConfiguration('test', 'test'); const service = new ExperimentService(user, new LoggerMock(), config, snykConfig); service.load();