Skip to content

Commit

Permalink
Merge pull request #4216 from snyk/feat/unmanaged-deps-severity-thres…
Browse files Browse the repository at this point in the history
…hold

feat: support severity threshold (unmanaged)
  • Loading branch information
Daniel Ekelund authored Nov 28, 2022
2 parents 3daf5c7 + cc329fd commit c028b50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/ecosystems/resolve-test-facts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
getSelf,
} from './unmanaged/utils';
import { sleep } from '../common';
import { SEVERITY } from '../snyk-test/common';

export async function resolveAndTestFacts(
ecosystem: Ecosystem,
Expand Down Expand Up @@ -91,13 +92,15 @@ async function fetchIssues(
start_time,
dep_graph_data,
component_details,
target_severity: SEVERITY,
orgId: string,
) {
const response: GetIssuesResponse = await getIssues(
{
dep_graph: dep_graph_data,
start_time,
component_details,
target_severity,
},
orgId,
);
Expand Down Expand Up @@ -148,6 +151,7 @@ export async function resolveAndTestFactsUnmanagedDeps(
const displayTargetFile = '';

let orgId = options.org || '';
const target_severity: SEVERITY = options.severityThreshold || SEVERITY.LOW;

if (orgId === '') {
const self = await getSelf();
Expand Down Expand Up @@ -181,6 +185,7 @@ export async function resolveAndTestFactsUnmanagedDeps(
start_time,
dep_graph_data,
component_details,
target_severity,
orgId,
);

Expand Down
1 change: 1 addition & 0 deletions src/lib/ecosystems/unmanaged/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export interface IssuesRequestAttributes {
start_time: number;
dep_graph: IssuesRequestDepGraphDataOpenAPI;
component_details: IssuesRequestComponentDetails;
target_severity: SEVERITY;
}

export interface Data {
Expand Down

0 comments on commit c028b50

Please sign in to comment.