diff --git a/CHANGELOG.md b/CHANGELOG.md index 28b153d..08073a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [v1.3.0] + +- Add new SCA flow which decreases execution time + ## [v1.2.2] - Fix detections count in SCA notifications @@ -30,6 +34,8 @@ The first stable release with the support of Secrets, SCA, TreeView, Violation Card, and more. +[v1.3.0]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.3.0 + [v1.2.2]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.2.2 [v1.2.1]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.2.1 diff --git a/package.json b/package.json index 1a203b4..f383279 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/cycodehq/vscode-extension" }, "homepage": "https://cycode.com/", - "version": "1.2.2", + "version": "1.3.0", "publisher": "cycode", "engines": { "vscode": "^1.63.0" @@ -110,6 +110,11 @@ "type": "string", "default": "", "markdownDescription": "Changes the app URL when running scans. Equivalent to setting CYCODE_APP_URL env var in the CLI." + }, + "cycode.experimentalScaSyncFlow": { + "type": "boolean", + "default": "true", + "description": "Enable experimental SCA sync flow" } } }, diff --git a/src/cli-wrapper/cli-wrapper.ts b/src/cli-wrapper/cli-wrapper.ts index 33b6bca..e1644aa 100644 --- a/src/cli-wrapper/cli-wrapper.ts +++ b/src/cli-wrapper/cli-wrapper.ts @@ -1,7 +1,9 @@ +import * as vscode from 'vscode'; import {IgnoreCommandConfig} from '../types/commands'; import {CliCommands, CommandParameters, getScanTypeCliValue} from './constants'; import {IConfig, RunCliResult, UserAgent} from './types'; import {getRunnableCliCommand} from './runner'; +import {experimentalScaSyncFlowProperty, extensionId} from '../utils/texts'; export const generateUserAgentCommandParam = (config: IConfig) => { const userAgent: UserAgent = { @@ -93,6 +95,15 @@ export const cliWrapper = { commandParams.push(CliCommands.Scan); commandParams.push(CommandParameters.scanType); commandParams.push(CommandParameters.SCAScanType); + + const experimentalScaSyncFlowPropertyEnabled = + vscode.workspace.getConfiguration(extensionId).get(experimentalScaSyncFlowProperty); + if (experimentalScaSyncFlowPropertyEnabled) { + // TODO(MarshalX): remove experimental setting if stable + commandParams.push(CommandParameters.Sync); + commandParams.push(CommandParameters.NoRestore); + } + commandParams.push(CliCommands.Path); commandParams.push(`"${params.path}"`); diff --git a/src/cli-wrapper/constants.ts b/src/cli-wrapper/constants.ts index d2e30d5..71558c9 100644 --- a/src/cli-wrapper/constants.ts +++ b/src/cli-wrapper/constants.ts @@ -20,9 +20,11 @@ export enum CommandParameters { Version = '--version', scanType = '--scan-type', SCAScanType = 'sca', + Sync = '--sync', + NoRestore = '--no-restore', } -export const MinCLIVersion = '1.7.0'; +export const MinCLIVersion = '1.9.0'; const SCAN_TYPE_TO_SCAN_TYPE_CLI_FLAG_VALUE = { [ScanType.Secrets]: 'secret', diff --git a/src/utils/texts.ts b/src/utils/texts.ts index f4ee0e1..4b56c52 100644 --- a/src/utils/texts.ts +++ b/src/utils/texts.ts @@ -3,6 +3,8 @@ export const publisherId = 'cycode'; export const extensionName = 'Cycode'; export const scanOnSaveProperty = 'scanOnSave'; +export const experimentalScaSyncFlowProperty = 'experimentalScaSyncFlow'; + export enum StatusBarTexts { ScanButton = '$(cycode-logo) Scan with Cycode', ScanWait = '$(loading~spin) Waiting for scan to complete….',