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

CM-40753 - Add sync flow for Secrets and IaC #102

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: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

## [v1.10.0]

- Add sync flow for Secrets and IaC

## [v1.9.4]

- Fix empty IaC scan results on Windows
Expand Down Expand Up @@ -90,6 +94,8 @@

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

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

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

[v1.9.3]: https://github.com/cycodehq/vscode-extension/releases/tag/v1.9.3
Expand Down Expand Up @@ -124,4 +130,4 @@ The first stable release with the support of Secrets, SCA, TreeView, Violation C

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

[Unreleased]: https://github.com/cycodehq/vscode-extension/compare/v1.9.4...HEAD
[Unreleased]: https://github.com/cycodehq/vscode-extension/compare/v1.10.0...HEAD
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cycode",
"displayName": "Cycode",
"version": "1.9.4",
"version": "1.10.0",
"publisher": "cycode",
"description": "Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.",
"repository": {
Expand Down Expand Up @@ -139,11 +139,6 @@
"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"
}
}
},
Expand Down
15 changes: 9 additions & 6 deletions src/cli-wrapper/cli-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ export const cliWrapper = {

commandParams.push(generateUserAgentCommandParam(config));
commandParams.push(CommandParameters.OutputFormatJson);

commandParams.push(CliCommands.Scan);
commandParams.push(CommandParameters.scanType);
commandParams.push(CommandParameters.secretScanType);
commandParams.push(CommandParameters.Sync);

commandParams.push(CliCommands.Path);
commandParams.push(`"${params.path}"`);

Expand All @@ -79,15 +84,12 @@ export const cliWrapper = {

commandParams.push(generateUserAgentCommandParam(config));
commandParams.push(CommandParameters.OutputFormatJson);

commandParams.push(CliCommands.Scan);
commandParams.push(CommandParameters.scanType);
commandParams.push(CommandParameters.scaScanType);

if (config.experimentalScaSyncFlow) {
// TODO(MarshalX): remove experimental setting if stable
commandParams.push(CommandParameters.Sync);
commandParams.push(CommandParameters.NoRestore);
}
commandParams.push(CommandParameters.Sync);
commandParams.push(CommandParameters.NoRestore);

commandParams.push(CliCommands.Path);
commandParams.push(`"${params.path}"`);
Expand Down Expand Up @@ -119,6 +121,7 @@ export const cliWrapper = {
commandParams.push(CliCommands.Scan);
commandParams.push(CommandParameters.scanType);
commandParams.push(CommandParameters.iacScanType);
commandParams.push(CommandParameters.Sync);

commandParams.push(CliCommands.Path);
commandParams.push(`"${params.path}"`);
Expand Down
1 change: 1 addition & 0 deletions src/cli-wrapper/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum CommandParameters {
ByPath = '--by-path',
UserAgent = '--user-agent',
scanType = '--scan-type',
secretScanType = 'secret',
scaScanType = 'sca',
iacScanType = 'iac',
sastScanType = 'sast',
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 @@ -16,7 +16,6 @@ export interface IConfig {
envName: string;
envVersion: string;
scanOnSaveEnabled: boolean;
experimentalScaSyncFlow: 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.10.7';
export const REQUIRED_CLI_VERSION = '1.11.0';

export const CLI_GITHUB = {
OWNER: 'cycodehq',
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 {
experimentalScaSyncFlowProperty,
extensionId,
publisherId,
scanOnSaveProperty,
Expand Down Expand Up @@ -69,12 +68,6 @@ export const config = {
.get<boolean>(scanOnSaveProperty);
return value === undefined ? false : value;
},
get experimentalScaSyncFlow(): boolean {
const value = vscode.workspace
.getConfiguration(extensionId)
.get<boolean>(experimentalScaSyncFlowProperty);
return value === undefined ? false : value;
},
get isOnPremiseInstallation(): boolean {
return !config.cliEnv.CYCODE_API_URL.endsWith(CYCODE_DOMAIN);
},
Expand Down
2 changes: 0 additions & 2 deletions src/utils/texts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ 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….',
Expand Down
Loading