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
1f4de309
Commit
1f4de309
authored
Mar 04, 2021
by
Subashis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include detected vul state check for findings
parent
3b6ae621
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
ee/app/models/vulnerabilities/finding.rb
ee/app/models/vulnerabilities/finding.rb
+1
-1
ee/changelogs/unreleased/291001-finding-vuln-state-inconsistecy.yml
...ogs/unreleased/291001-finding-vuln-state-inconsistecy.yml
+5
-0
ee/spec/models/vulnerabilities/finding_spec.rb
ee/spec/models/vulnerabilities/finding_spec.rb
+5
-0
No files found.
ee/app/models/vulnerabilities/finding.rb
View file @
1f4de309
...
...
@@ -123,7 +123,7 @@ module Vulnerabilities
def
state
return
'dismissed'
if
dismissal_feedback
.
present?
if
vulnerability
.
nil?
if
vulnerability
.
nil?
||
vulnerability
.
detected?
'detected'
elsif
vulnerability
.
resolved?
'resolved'
...
...
ee/changelogs/unreleased/291001-finding-vuln-state-inconsistecy.yml
0 → 100644
View file @
1f4de309
---
title
:
Include detected vulnerability in finding state check
merge_request
:
55806
author
:
type
:
added
ee/spec/models/vulnerabilities/finding_spec.rb
View file @
1f4de309
...
...
@@ -655,6 +655,7 @@ RSpec.describe Vulnerabilities::Finding do
let
(
:confirmed_finding
)
{
create
(
:vulnerabilities_finding
,
:confirmed
)
}
let
(
:resolved_finding
)
{
create
(
:vulnerabilities_finding
,
:resolved
)
}
let
(
:dismissed_finding
)
{
create
(
:vulnerabilities_finding
,
:dismissed
)
}
let
(
:detected_finding
)
{
create
(
:vulnerabilities_finding
,
:detected
)
}
let
(
:finding_with_issue
)
{
create
(
:vulnerabilities_finding
,
:with_issue_feedback
)
}
it
'returns the expected state for a unresolved finding'
do
...
...
@@ -673,6 +674,10 @@ RSpec.describe Vulnerabilities::Finding do
expect
(
dismissed_finding
.
state
).
to
eq
'dismissed'
end
it
'returns the expected state for a detected finding'
do
expect
(
detected_finding
.
state
).
to
eq
'detected'
end
context
'when a vulnerability present for a dismissed finding'
do
before
do
create
(
:vulnerability
,
project:
dismissed_finding
.
project
,
findings:
[
dismissed_finding
])
...
...
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