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
654fb040
Commit
654fb040
authored
Dec 06, 2021
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put vuln finding link ingest behind feature flag
Changelog: added
parent
60578471
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
ee/app/services/security/ingestion/tasks/ingest_finding_links.rb
...services/security/ingestion/tasks/ingest_finding_links.rb
+6
-0
ee/spec/services/security/ingestion/tasks/ingest_finding_links_spec.rb
...ces/security/ingestion/tasks/ingest_finding_links_spec.rb
+20
-3
No files found.
ee/app/services/security/ingestion/tasks/ingest_finding_links.rb
View file @
654fb040
...
...
@@ -9,6 +9,12 @@ module Security
self
.
model
=
Vulnerabilities
::
FindingLink
def
execute
return
unless
Feature
.
enabled?
(
:vulnerability_finding_replace_metadata
)
super
end
private
def
attributes
...
...
ee/spec/services/security/ingestion/tasks/ingest_finding_links_spec.rb
View file @
654fb040
...
...
@@ -20,9 +20,26 @@ RSpec.describe Security::Ingestion::Tasks::IngestFindingLinks do
create
(
:finding_link
,
finding:
finding_2
,
url:
finding_link
.
url
)
end
it
'creates finding links for the new records'
do
expect
{
ingest_finding_links
}.
to
change
{
Vulnerabilities
::
FindingLink
.
count
}.
by
(
1
)
.
and
change
{
finding_1
.
finding_links
.
count
}.
by
(
1
)
context
'when the replace raw metadata flag is on'
do
before
do
stub_feature_flags
(
vulnerability_finding_replace_metadata:
true
)
end
it
'creates finding links for the new records'
do
expect
{
ingest_finding_links
}.
to
change
{
Vulnerabilities
::
FindingLink
.
count
}.
by
(
1
)
.
and
change
{
finding_1
.
finding_links
.
count
}.
by
(
1
)
end
end
context
'when the replace raw metadata flag is off'
do
before
do
stub_feature_flags
(
vulnerability_finding_replace_metadata:
false
)
end
it
'does not create finding links for the new records'
do
expect
{
ingest_finding_links
}.
to
change
{
Vulnerabilities
::
FindingLink
.
count
}.
by
(
0
)
.
and
change
{
finding_1
.
finding_links
.
count
}.
by
(
0
)
end
end
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