Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: release workflows [IDE-155] #434

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Comment on lines +3 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea of this PR and #432 to remove everything related to Amplitude?
Would we need to remove also code related to @amplitude/ampli and @amplitude/experiment-node-server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experiment service is different from the other analytics, we can still use it for canary/feature flag services.

## [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
Loading