Commit 5349b8d6 authored by Jarka Košanová's avatar Jarka Košanová

Merge branch...

Merge branch '216300-ensure-mr-feedback-creating-an-mr-from-a-remediation-works-as-expected-on-new-standalone-BE' into 'master'

Implement BE for "MR feedback" (creating an MR from a remediation)

See merge request gitlab-org/gitlab!31142
parents 596f481e 0bd3348f
......@@ -14,6 +14,7 @@ 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,
create_mr_url: create_vulnerability_feedback_merge_request_path(vulnerability.finding.project),
timestamp: Time.now.to_i
}
end
......@@ -24,7 +25,8 @@ module VulnerabilitiesHelper
{
id: pipeline.id,
created_at: pipeline.created_at.iso8601,
url: pipeline_path(pipeline)
url: pipeline_path(pipeline),
source_branch: pipeline.ref
}
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,7 @@ describe VulnerabilitiesHelper do
has_mr: anything,
vulnerability_feedback_help_path: kind_of(String),
finding_json: kind_of(String),
create_mr_url: "/#{project.full_path}/-/vulnerability_feedback",
timestamp: Time.now.to_i
)
end
......@@ -82,7 +84,8 @@ describe VulnerabilitiesHelper do
expect(pipelineData).to include(
'id' => pipeline.id,
'created_at' => pipeline.created_at.iso8601,
'url' => be_present
'url' => be_present,
'source_branch' => pipeline.ref
)
end
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