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
632e353a
Commit
632e353a
authored
Jan 05, 2021
by
Mehmet Emin INAC
Committed by
Markus Koller
Jan 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `store_security_findings` feature flag related code
The feature flag has already been active for a long time.
parent
f8b6dbab
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
316 additions
and
373 deletions
+316
-373
ee/app/finders/security/findings_finder.rb
ee/app/finders/security/findings_finder.rb
+1
-5
ee/app/services/security/store_scan_service.rb
ee/app/services/security/store_scan_service.rb
+0
-2
ee/changelogs/unreleased/276011_remove_store_security_findings_feature_flag.yml
...ed/276011_remove_store_security_findings_feature_flag.yml
+5
-0
ee/config/feature_flags/development/store_security_findings.yml
...fig/feature_flags/development/store_security_findings.yml
+0
-8
ee/spec/finders/security/findings_finder_spec.rb
ee/spec/finders/security/findings_finder_spec.rb
+255
-271
ee/spec/services/security/store_scan_service_spec.rb
ee/spec/services/security/store_scan_service_spec.rb
+55
-87
No files found.
ee/app/finders/security/findings_finder.rb
View file @
632e353a
...
...
@@ -29,7 +29,7 @@ module Security
end
def
execute
return
unless
can_use
_security_findings?
return
unless
has
_security_findings?
ResultSet
.
new
(
security_findings
,
findings
)
end
...
...
@@ -39,10 +39,6 @@ module Security
attr_reader
:pipeline
,
:params
delegate
:project
,
:has_security_findings?
,
to: :pipeline
,
private:
true
def
can_use_security_findings?
Feature
.
enabled?
(
:store_security_findings
,
project
)
&&
has_security_findings?
end
def
findings
security_findings
.
map
(
&
method
(
:build_vulnerability_finding
))
end
...
...
ee/app/services/security/store_scan_service.rb
View file @
632e353a
...
...
@@ -19,8 +19,6 @@ module Security
end
def
execute
return
security_scan
unless
Feature
.
enabled?
(
:store_security_findings
,
project
)
StoreFindingsMetadataService
.
execute
(
security_scan
,
security_report
)
deduplicate_findings?
?
update_deduplicated_findings
:
register_finding_keys
...
...
ee/changelogs/unreleased/276011_remove_store_security_findings_feature_flag.yml
0 → 100644
View file @
632e353a
---
title
:
Remove `store_security_findings` feature flag
merge_request
:
48357
author
:
type
:
changed
ee/config/feature_flags/development/store_security_findings.yml
deleted
100644 → 0
View file @
f8b6dbab
---
name
:
store_security_findings
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44312
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/276011
milestone
:
'
13.6'
type
:
development
group
:
group::threat insights
default_enabled
:
false
ee/spec/finders/security/findings_finder_spec.rb
View file @
632e353a
...
...
@@ -30,21 +30,6 @@ RSpec.describe Security::FindingsFinder do
end
describe
'#execute'
do
context
'when the feature is not available'
do
before
do
stub_feature_flags
(
store_security_findings:
false
)
end
subject
{
service_object
.
execute
}
it
{
is_expected
.
to
be_nil
}
end
context
'when the feature is available'
do
before
do
stub_feature_flags
(
store_security_findings:
true
)
end
context
'when the pipeline does not have security findings'
do
subject
{
service_object
.
execute
}
...
...
@@ -362,5 +347,4 @@ RSpec.describe Security::FindingsFinder do
end
end
end
end
end
ee/spec/services/security/store_scan_service_spec.rb
View file @
632e353a
...
...
@@ -41,37 +41,6 @@ RSpec.describe Security::StoreScanService do
known_keys
.
add
(
finding_key
)
end
context
'when the `store_security_findings` feature is not enabled'
do
before
do
stub_feature_flags
(
store_security_findings:
false
)
end
it
'does not call the `Security::StoreFindingsMetadataService`'
do
store_scan
expect
(
Security
::
StoreFindingsMetadataService
).
not_to
have_received
(
:execute
)
end
context
'when the security scan already exists for the artifact'
do
let_it_be
(
:security_scan
)
{
create
(
:security_scan
,
build:
artifact
.
job
,
scan_type: :sast
)
}
it
'does not create a new security scan'
do
expect
{
store_scan
}.
not_to
change
{
artifact
.
job
.
security_scans
.
count
}
end
end
context
'when the security scan does not exist for the artifact'
do
it
'creates a new security scan'
do
expect
{
store_scan
}.
to
change
{
artifact
.
job
.
security_scans
.
sast
.
count
}.
by
(
1
)
end
end
end
context
'when the `store_security_findings` feature is enabled'
do
before
do
stub_feature_flags
(
store_security_findings:
artifact
.
project
)
end
it
'calls the `Security::StoreFindingsMetadataService` to store findings'
do
store_scan
...
...
@@ -159,5 +128,4 @@ RSpec.describe Security::StoreScanService do
end
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