Skip to content

Commit

Permalink
CM-37262 - Remove SAST feature switch and enable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Jun 24, 2024
1 parent 33c1486 commit bc8657b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [v1.9.0]

- Add SAST support

## [v1.8.0]

- Add "Ignore this violation" for violation card of secrets
Expand Down Expand Up @@ -65,6 +69,8 @@

The first stable release with the support of Secrets, SCA, TreeView, Violation Card, and more.

[v1.9.0]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.9.0

[v1.8.0]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.8.0

[v1.7.0]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.7.0
Expand Down
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/cycodehq/vscode-extension"
},
"homepage": "https://cycode.com/",
"version": "1.8.0",
"version": "1.9.0",
"publisher": "cycode",
"engines": {
"vscode": "^1.63.0"
Expand Down Expand Up @@ -69,7 +69,7 @@
},
{
"command": "cycode.sastScanForProject",
"when": "viewItem == SAST && config.cycode.experimentalSastSupport",
"when": "viewItem == SAST",
"group": "inline"
},
{
Expand All @@ -82,7 +82,7 @@
},
{
"command": "cycode.sastScanForProject",
"when": "view == scan.treeView && viewItem == SAST && config.cycode.experimentalSastSupport"
"when": "view == scan.treeView && viewItem == SAST"
},
{
"command": "cycode.scaScan",
Expand Down Expand Up @@ -139,11 +139,6 @@
"type": "boolean",
"default": true,
"description": "Enable experimental SCA sync flow"
},
"cycode.experimentalSastSupport": {
"type": "boolean",
"default": false,
"description": "Enable experimental SAST support"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion src/cli-wrapper/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface IConfig {
envVersion: string;
scanOnSaveEnabled: boolean;
experimentalScaSyncFlow: boolean;
experimentalSastSupport: boolean;
}

export type CliConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const getScanTypeDisplayName = (scanType: string): string => {

export const DIAGNOSTIC_CODE_SEPARATOR = '::';

export const REQUIRED_CLI_VERSION = '1.9.5';
export const REQUIRED_CLI_VERSION = '1.10.1';

export const CLI_GITHUB = {
OWNER: 'cycodehq',
Expand Down
3 changes: 1 addition & 2 deletions src/providers/tree-view/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as vscode from 'vscode';
import * as path from 'path';
import {TreeViewItem} from './item';
import {ScanType, ScanTypeDisplayName} from '../../constants';
import {config} from '../../utils/config';

const _PATH_TO_RESOURCES = path.join(__filename, '..', '..', 'resources');
const PATH_TO_SCAN_TYPE_ICONS = path.join(_PATH_TO_RESOURCES, 'scan-type');
Expand Down Expand Up @@ -48,7 +47,7 @@ const getSastSectionItem = (description: string): TreeViewItem => new TreeViewIt
collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
scanSectionType: ScanType.Sast,
customIconPath: getScanTypeIconPath(ScanType.Sast),
description: config.experimentalSastSupport ? description : '(coming soon)',
description: description,
});

const getIacSectionItem = (description: string): TreeViewItem => new TreeViewItem({
Expand Down
7 changes: 0 additions & 7 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as vscode from 'vscode';
import {
experimentalSastSupportProperty,
experimentalScaSyncFlowProperty,
extensionId,
publisherId,
Expand Down Expand Up @@ -70,12 +69,6 @@ export const config = {
.get<boolean>(experimentalScaSyncFlowProperty);
return value === undefined ? false : value;
},
get experimentalSastSupport(): boolean {
const value = vscode.workspace
.getConfiguration(extensionId)
.get<boolean>(experimentalSastSupportProperty);
return value === undefined ? false : value;
},
};

export const validateConfig = () => {
Expand Down
1 change: 0 additions & 1 deletion src/utils/texts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const extensionName = 'Cycode';
export const scanOnSaveProperty = 'scanOnSave';

export const experimentalScaSyncFlowProperty = 'experimentalScaSyncFlow';
export const experimentalSastSupportProperty = 'experimentalSastSupport';

export enum StatusBarTexts {
ScanButton = '$(cycode-logo) Scan with Cycode',
Expand Down
8 changes: 1 addition & 7 deletions src/views/scan/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default `
<button id="scan-vulnerabilities-button">Scan for hardcoded secrets</button>
<br />
<button id="scan-package-vulnerabilities-button">Scan for package vulnerabilities</button>
<br id="scan-sast-br" />
<br />
<button id="scan-sast-button">Scan for Code Security</button>
<br />
<button id="scan-iac-button">Scan for Infrastructure As Code</button>
Expand Down Expand Up @@ -87,12 +87,6 @@ export default `
.addEventListener('click', () => {
vscode.postMessage({ command: 'runOpenCycodeSettingsCommand' });
});
window.addEventListener('message', event => {
const display = event.data.isSastSupported ? 'block' : 'none';
document.getElementById('scan-sast-br').style.display = display;
document.getElementById('scan-sast-button').style.display = display;
});
</script>
</body>
</html>
Expand Down
7 changes: 0 additions & 7 deletions src/views/scan/scan-view.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import * as vscode from 'vscode';
import {ActionCommandMapping, CycodeView} from '../cycode-view';
import {ExecuteCommandMessages} from '../utils';
import {VscodeCommands} from '../../utils/commands';
import content from './content';
import {config} from '../../utils/config';


export default class ScanView extends CycodeView {
Expand Down Expand Up @@ -34,9 +32,4 @@ export default class ScanView extends CycodeView {
];
super(content, actionCommandMapping);
}

public resolveWebviewView(webviewView: vscode.WebviewView): void {
super.resolveWebviewView(webviewView);
this._view?.webview.postMessage({isSastSupported: config.experimentalSastSupport});
}
}

0 comments on commit bc8657b

Please sign in to comment.