Skip to content

Commit

Permalink
fix: release workflows [IDE-155] (#434)
Browse files Browse the repository at this point in the history
* fix: release workflows [IDE-155]

* docs: update changelog
  • Loading branch information
bastiandoetsch authored Mar 1, 2024
1 parent dc0eea3 commit 91ed2c4
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/release-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/release-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion scripts/patchPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
1 change: 0 additions & 1 deletion snyk.config.json
Original file line number Diff line number Diff line change
@@ -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}"
}
4 changes: 1 addition & 3 deletions src/snyk/common/configuration/snykConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ suite('ExperimentService', () => {

sinon.stub(SnykConfiguration, 'get').resolves({
amplitudeExperimentApiKey: 'test',
segmentWriteKey: 'test',
} as SnykConfiguration);

fetchStub = sinon.stub();
Expand Down Expand Up @@ -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();

Expand All @@ -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();

Expand Down

0 comments on commit 91ed2c4

Please sign in to comment.