Skip to content

Commit 2ef7813

Browse files
committed
Add severity to issue output
The spec requires these to be one of info, normal, or critical
1 parent bdde039 commit 2ef7813

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/cc/engine/bundler_audit.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ module CC
55
module Engine
66
class BundlerAudit
77
GemfileLockNotFound = Class.new(StandardError)
8+
SEVERITIES = {
9+
"High" => "critical",
10+
"Low" => "info",
11+
"Medium" => "normal",
12+
}
813

914
def initialize(directory: , io: , engine_config: )
1015
@directory = directory
@@ -66,6 +71,7 @@ def issue_from_raw(raw_issue)
6671
remediation_points: remediation_points(
6772
raw_issue_hash['Version'], raw_issue_hash['Solution']
6873
),
74+
severity: SEVERITIES[raw_issue_hash["Criticality"]],
6975
type: 'Issue',
7076
}
7177
end

spec/cc/engine/bundler_audit_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module CC::Engine
3737
lines: { begin: nil, end: nil }
3838
},
3939
remediation_points: 500_000,
40+
severity: "normal",
4041
type: "Issue",
4142
}.to_json
4243
io = StringIO.new

0 commit comments

Comments
 (0)