From bc8657bfe8c4ce685390867acc0ed814838fccee Mon Sep 17 00:00:00 2001 From: Ilya Siamionau Date: Mon, 24 Jun 2024 16:58:53 +0200 Subject: [PATCH] CM-37262 - Remove SAST feature switch and enable by default --- CHANGELOG.md | 6 ++++++ package.json | 11 +++-------- src/cli-wrapper/types.ts | 1 - src/constants.ts | 2 +- src/providers/tree-view/constants.ts | 3 +-- src/utils/config.ts | 7 ------- src/utils/texts.ts | 1 - src/views/scan/content.ts | 8 +------- src/views/scan/scan-view.ts | 7 ------- 9 files changed, 12 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e5805..3baadf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [v1.9.0] + +- Add SAST support + ## [v1.8.0] - Add "Ignore this violation" for violation card of secrets @@ -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 diff --git a/package.json b/package.json index 1f032b1..15e1079 100644 --- a/package.json +++ b/package.json @@ -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" @@ -69,7 +69,7 @@ }, { "command": "cycode.sastScanForProject", - "when": "viewItem == SAST && config.cycode.experimentalSastSupport", + "when": "viewItem == SAST", "group": "inline" }, { @@ -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", @@ -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" } } }, diff --git a/src/cli-wrapper/types.ts b/src/cli-wrapper/types.ts index 75554a1..b7f2081 100644 --- a/src/cli-wrapper/types.ts +++ b/src/cli-wrapper/types.ts @@ -17,7 +17,6 @@ export interface IConfig { envVersion: string; scanOnSaveEnabled: boolean; experimentalScaSyncFlow: boolean; - experimentalSastSupport: boolean; } export type CliConfig = { diff --git a/src/constants.ts b/src/constants.ts index 9956bd1..ce7be30 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -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', diff --git a/src/providers/tree-view/constants.ts b/src/providers/tree-view/constants.ts index df7fbdf..10265de 100644 --- a/src/providers/tree-view/constants.ts +++ b/src/providers/tree-view/constants.ts @@ -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'); @@ -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({ diff --git a/src/utils/config.ts b/src/utils/config.ts index 6ecf72f..54ccd66 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,6 +1,5 @@ import * as vscode from 'vscode'; import { - experimentalSastSupportProperty, experimentalScaSyncFlowProperty, extensionId, publisherId, @@ -70,12 +69,6 @@ export const config = { .get(experimentalScaSyncFlowProperty); return value === undefined ? false : value; }, - get experimentalSastSupport(): boolean { - const value = vscode.workspace - .getConfiguration(extensionId) - .get(experimentalSastSupportProperty); - return value === undefined ? false : value; - }, }; export const validateConfig = () => { diff --git a/src/utils/texts.ts b/src/utils/texts.ts index 2aaf318..4b56c52 100644 --- a/src/utils/texts.ts +++ b/src/utils/texts.ts @@ -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', diff --git a/src/views/scan/content.ts b/src/views/scan/content.ts index dbb933a..899d24a 100644 --- a/src/views/scan/content.ts +++ b/src/views/scan/content.ts @@ -36,7 +36,7 @@ export default `
-
+

@@ -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; - }); diff --git a/src/views/scan/scan-view.ts b/src/views/scan/scan-view.ts index d176a20..a420fe3 100644 --- a/src/views/scan/scan-view.ts +++ b/src/views/scan/scan-view.ts @@ -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 { @@ -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}); - } }