Commit 9546e89c authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '267021_fix_ff_access' into 'master'

Fix `project` attribute of `StoreScanService` class

See merge request gitlab-org/gitlab!48013
parents 3b46ce3c b5f03623
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# @param known_keys [Set] the set of known finding keys stored by previous invocations of this service class. # @param known_keys [Set] the set of known finding keys stored by previous invocations of this service class.
# @param deduplicate [Boolean] attribute to force running deduplication logic. # @param deduplicate [Boolean] attribute to force running deduplication logic.
module Security module Security
class StoreScanService < ::BaseService class StoreScanService
def self.execute(artifact, known_keys, deduplicate) def self.execute(artifact, known_keys, deduplicate)
new(artifact, known_keys, deduplicate).execute new(artifact, known_keys, deduplicate).execute
end end
...@@ -30,7 +30,7 @@ module Security ...@@ -30,7 +30,7 @@ module Security
private private
attr_reader :artifact, :known_keys, :deduplicate attr_reader :artifact, :known_keys, :deduplicate
delegate :security_report, to: :artifact, private: true delegate :security_report, :project, to: :artifact, private: true
def security_scan def security_scan
@security_scan ||= Security::Scan.safe_find_or_create_by!(build: artifact.job, scan_type: artifact.file_type) @security_scan ||= Security::Scan.safe_find_or_create_by!(build: artifact.job, scan_type: artifact.file_type)
......
...@@ -69,7 +69,7 @@ RSpec.describe Security::StoreScanService do ...@@ -69,7 +69,7 @@ RSpec.describe Security::StoreScanService do
context 'when the `store_security_findings` feature is enabled' do context 'when the `store_security_findings` feature is enabled' do
before do before do
stub_feature_flags(store_security_findings: true) stub_feature_flags(store_security_findings: artifact.project)
end end
it 'calls the `Security::StoreFindingsMetadataService` to store findings' do it 'calls the `Security::StoreFindingsMetadataService` to store findings' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment