Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
94c10b53
Commit
94c10b53
authored
May 06, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to create MR from a vulnerability
parent
47ed79de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
ee/app/helpers/vulnerabilities_helper.rb
ee/app/helpers/vulnerabilities_helper.rb
+4
-1
ee/spec/helpers/vulnerabilities_helper_spec.rb
ee/spec/helpers/vulnerabilities_helper_spec.rb
+4
-0
No files found.
ee/app/helpers/vulnerabilities_helper.rb
View file @
94c10b53
...
@@ -14,6 +14,8 @@ module VulnerabilitiesHelper
...
@@ -14,6 +14,8 @@ module VulnerabilitiesHelper
has_mr:
!!
vulnerability
.
finding
.
merge_request_feedback
.
try
(
:merge_request_iid
),
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'
),
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
,
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
timestamp:
Time
.
now
.
to_i
}
}
end
end
...
@@ -40,7 +42,8 @@ module VulnerabilitiesHelper
...
@@ -40,7 +42,8 @@ module VulnerabilitiesHelper
:name
,
:name
,
:issue_feedback
,
:issue_feedback
,
:merge_request_feedback
,
:merge_request_feedback
,
:project
:project
,
:remediations
).
merge
(
).
merge
(
solution:
remediation
?
remediation
[
'summary'
]
:
occurrence
[
:solution
]
solution:
remediation
?
remediation
[
'summary'
]
:
occurrence
[
:solution
]
)
)
...
...
ee/spec/helpers/vulnerabilities_helper_spec.rb
View file @
94c10b53
...
@@ -30,6 +30,7 @@ describe VulnerabilitiesHelper do
...
@@ -30,6 +30,7 @@ describe VulnerabilitiesHelper do
:name
,
:name
,
:issue_feedback
,
:issue_feedback
,
:project
,
:project
,
:remediations
,
:solution
:solution
)
)
end
end
...
@@ -64,6 +65,8 @@ describe VulnerabilitiesHelper do
...
@@ -64,6 +65,8 @@ describe VulnerabilitiesHelper do
has_mr:
anything
,
has_mr:
anything
,
vulnerability_feedback_help_path:
kind_of
(
String
),
vulnerability_feedback_help_path:
kind_of
(
String
),
finding_json:
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
timestamp:
Time
.
now
.
to_i
)
)
end
end
...
@@ -113,6 +116,7 @@ describe VulnerabilitiesHelper do
...
@@ -113,6 +116,7 @@ describe VulnerabilitiesHelper do
location:
finding
.
location
,
location:
finding
.
location
,
name:
finding
.
name
,
name:
finding
.
name
,
project:
kind_of
(
Grape
::
Entity
::
Exposure
::
NestingExposure
::
OutputBuilder
),
project:
kind_of
(
Grape
::
Entity
::
Exposure
::
NestingExposure
::
OutputBuilder
),
remediations:
finding
.
remediations
,
solution:
kind_of
(
String
)
solution:
kind_of
(
String
)
)
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment