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

feat: move delta preview to settings [IDE-597] #525

Merged
merged 3 commits into from
Aug 30, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Snyk Security Changelog

## [2.19.0]
- Moved delta scan preview setting to settings page.

## [2.18.0]
- Added base branch selection for IaC and OSS

Expand Down
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@
"description": "Preview features that are currently in development. Setting keys will be removed when features become stable.",
"propertyNames": true,
"properties": {}
},
"snyk.netNewVsAllIssues": {
"type": "string",
"default": "All issues",
"description": "Specifies whether to see only net new issues or all issues. Only applies to Code Security and Code Quality.",
"enum": [
"All issues",
"Net new issues"
],
"enumDescriptions": [
"Shows all issues that have been identified, including both new and existing issues.",
"Shows only new issues that have been introduced in the latest scan, filtering out previously known issues."
],
"markdownDescription": "Specifies whether to see only net new issues or all issues. Only applies to Code Security and Code Quality.\n\nNote: this is an experimental feature. Please reach out to [support.snyk.io](https://support.snyk.io) for more details."
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions src/snyk/common/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import {
import SecretStorageAdapter from '../vscode/secretStorage';
import { IVSCodeWorkspace } from '../vscode/workspace';

const NEWISSUES = 'Net new issues';

export type FeaturesConfiguration = {
ossEnabled: boolean | undefined;
codeSecurityEnabled: boolean | undefined;
Expand Down Expand Up @@ -247,9 +249,11 @@ export class Configuration implements IConfiguration {
}

getDeltaFindingsEnabled(): boolean {
return (
this.workspace.getConfiguration<boolean>(CONFIGURATION_IDENTIFIER, this.getConfigName(DELTA_FINDINGS)) ?? false
const selectionValue = this.workspace.getConfiguration<string>(
CONFIGURATION_IDENTIFIER,
this.getConfigName(DELTA_FINDINGS),
);
return selectionValue === NEWISSUES;
}

getAuthenticationMethod(): string {
Expand Down
2 changes: 1 addition & 1 deletion src/snyk/common/constants/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ export const TRUSTED_FOLDERS = `${CONFIGURATION_IDENTIFIER}.trustedFolders`;
export const FOLDER_CONFIGS = `${CONFIGURATION_IDENTIFIER}.folderConfigs`;
export const SCANNING_MODE = `${CONFIGURATION_IDENTIFIER}.scanningMode`;

export const DELTA_FINDINGS = `${FEATURES_PREVIEW_SETTING}.deltaFindings`;
export const DELTA_FINDINGS = `${CONFIGURATION_IDENTIFIER}.netNewVsAllIssues`;
4 changes: 0 additions & 4 deletions src/snyk/snykOss/providers/ossVulnerabilityTreeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ export default class OssIssueTreeProvider extends ProductIssueTreeProvider<OssIs

const folderSeverity = ProductIssueTreeProvider.getHighestSeverity(folderSeverityCounts);

if (folderVulnCount == 0) {
continue;
}

const baseBranchNode = this.getBaseBranch(uri.fsPath);
if (folderVulnCount == 0) {
this.addBaseBranchNode(baseBranchNode, nodes);
Expand Down
Loading