Skip to content

Commit

Permalink
fix: new json field infrastructureAsCodeSuccesses GA
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiu-snyk committed Aug 22, 2024
1 parent bfd3036 commit d4b1ded
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 400 deletions.
313 changes: 0 additions & 313 deletions src/lib/iac/test/v2/json-old.ts

This file was deleted.

15 changes: 4 additions & 11 deletions src/lib/iac/test/v2/output.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Ora } from 'ora';
import { EOL } from 'os';
import { convertEngineToJsonResults } from './json';
import { convertEngineToJsonResults as oldConvertEngineToJsonResults } from './json-old';
import { TestOutput } from './scan/results';
import { previewFeaturesEnabled } from '../../../preview-features-enabled';
import { TestCommandResult } from '../../../../cli/commands/types';
import {
formatIacTestFailures,
Expand Down Expand Up @@ -84,15 +82,10 @@ function buildTestCommandResultData({
scanResult.results?.metadata?.projectName ?? path.basename(process.cwd());

const jsonData = jsonStringifyLargeObject(
previewFeaturesEnabled()
? convertEngineToJsonResults({
results: scanResult,
projectName,
})
: oldConvertEngineToJsonResults({
results: scanResult,
projectName,
}),
convertEngineToJsonResults({
results: scanResult,
projectName,
}),
);

const sarifData = jsonStringifyLargeObject(
Expand Down
12 changes: 4 additions & 8 deletions src/lib/iac/test/v2/scan/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import config from '../../../../config';
import { api, getOAuthToken } from '../../../../api-token';
import envPaths from 'env-paths';
import { restoreEnvProxy } from '../../../env-utils';
import { previewFeaturesEnabled } from '../../../../preview-features-enabled';

const debug = newDebug('snyk-iac');
const debugOutput = newDebug('snyk-iac:output');
Expand Down Expand Up @@ -125,13 +124,10 @@ function processFlags(

flags.push('-output', outputPath);

// TODO: IAC-2962 - Remove condition after the feature is GA
if (previewFeaturesEnabled()) {
// to reduce the size of the output
flags.push('-exclude-raw-results');
// required for infrastructureAsCodeSuccesses to be populated
flags.push('-include-passed-vulnerabilities');
}
// to reduce the size of the output
flags.push('-exclude-raw-results');
// required for infrastructureAsCodeSuccesses to be populated
flags.push('-include-passed-vulnerabilities');

if (options.severityThreshold) {
flags.push('-severity-threshold', options.severityThreshold);
Expand Down
Loading

0 comments on commit d4b1ded

Please sign in to comment.