Commit 94c10b53 authored by Jonathan Schafer's avatar Jonathan Schafer

Add ability to create MR from a vulnerability

parent 47ed79de
......@@ -14,6 +14,8 @@ module VulnerabilitiesHelper
has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_iid),
vulnerability_feedback_help_path: help_page_path('user/application_security/index', anchor: 'interacting-with-the-vulnerabilities'),
finding_json: vulnerability_finding_data(vulnerability.finding).to_json,
source_branch: pipeline&.ref.to_s,
create_mr_url: create_vulnerability_feedback_merge_request_path(vulnerability.finding.project),
timestamp: Time.now.to_i
}
end
......@@ -40,7 +42,8 @@ module VulnerabilitiesHelper
:name,
:issue_feedback,
:merge_request_feedback,
:project
:project,
:remediations
).merge(
solution: remediation ? remediation['summary'] : occurrence[:solution]
)
......
......@@ -30,6 +30,7 @@ describe VulnerabilitiesHelper do
:name,
:issue_feedback,
:project,
:remediations,
:solution
)
end
......@@ -64,6 +65,8 @@ describe VulnerabilitiesHelper do
has_mr: anything,
vulnerability_feedback_help_path: kind_of(String),
finding_json: kind_of(String),
source_branch: kind_of(String),
create_mr_url: "/#{project.full_path}/-/vulnerability_feedback",
timestamp: Time.now.to_i
)
end
......@@ -113,6 +116,7 @@ describe VulnerabilitiesHelper do
location: finding.location,
name: finding.name,
project: kind_of(Grape::Entity::Exposure::NestingExposure::OutputBuilder),
remediations: finding.remediations,
solution: kind_of(String)
)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment