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
d0b6d109
Commit
d0b6d109
authored
Dec 12, 2019
by
scardoso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address MR comments and fix rubocop issues
parent
b33580f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
18 deletions
+5
-18
ee/app/controllers/concerns/project_vulnerability_findings_actions.rb
...ollers/concerns/project_vulnerability_findings_actions.rb
+1
-1
ee/lib/gitlab/vulnerabilities/summary.rb
ee/lib/gitlab/vulnerabilities/summary.rb
+1
-2
ee/spec/lib/gitlab/vulnerabilities/summary_spec.rb
ee/spec/lib/gitlab/vulnerabilities/summary_spec.rb
+3
-15
No files found.
ee/app/controllers/concerns/project_vulnerability_findings_actions.rb
View file @
d0b6d109
...
...
@@ -23,7 +23,7 @@ module ProjectVulnerabilityFindingsActions
end
def
summary
summary
=
Gitlab
::
Vulnerabilities
::
Summary
.
new
(
group
,
filter_params
).
vulnerabilitie
s_counter
summary
=
Gitlab
::
Vulnerabilities
::
Summary
.
new
(
group
,
filter_params
).
finding
s_counter
respond_to
do
|
format
|
format
.
json
do
...
...
ee/lib/gitlab/vulnerabilities/summary.rb
View file @
d0b6d109
...
...
@@ -10,11 +10,10 @@ module Gitlab
@group
=
group
end
def
vulnerabilitie
s_counter
def
finding
s_counter
return
cached_vulnerability_summary
if
use_vulnerability_cache?
vulnerabilities
=
found_vulnerabilities
.
counted_by_severity
VulnerabilitySummarySerializer
.
new
.
represent
(
vulnerabilities
)
end
...
...
ee/spec/lib/gitlab/vulnerabilities/summary_spec.rb
View file @
d0b6d109
...
...
@@ -10,11 +10,11 @@ describe Gitlab::Vulnerabilities::Summary do
before
do
create_vulnerabilities
(
1
,
project1
,
{
severity: :medium
,
report_type: :sast
})
create_vulnerabilities
(
2
,
project2
,
{
severity: :high
,
report_type: :sast
})
create_vulnerabilities
(
2
,
project2
,
{
severity: :high
,
report_type: :sast
})
end
describe
'#
vulnerabilitie
s_counter'
,
:use_clean_rails_memory_store_caching
do
subject
(
:counter
)
{
described_class
.
new
(
group
,
filters
).
vulnerabilitie
s_counter
}
describe
'#
finding
s_counter'
,
:use_clean_rails_memory_store_caching
do
subject
(
:counter
)
{
described_class
.
new
(
group
,
filters
).
finding
s_counter
}
context
'feature disabled'
do
before
do
...
...
@@ -60,18 +60,6 @@ describe Gitlab::Vulnerabilities::Summary do
expect
(
counter
[
:high
]).
to
eq
(
2
)
end
end
context
'multiple projects with vulnerabilities'
do
before
do
Timecop
.
freeze
(
Date
.
today
-
1
)
do
create_vulnerabilities
(
1
,
project1
)
end
Timecop
.
freeze
(
Date
.
today
-
4
)
do
create_vulnerabilities
(
1
,
project2
)
end
end
end
end
def
create_vulnerabilities
(
count
,
project
,
options
=
{})
...
...
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