Commit 11757d5b authored by Olivier Gonzalez's avatar Olivier Gonzalez

Add feature flag for container scanning parsing

Skip parsing of container scanning report if feature flag is disabled.
parent 8ff4dfe6
......@@ -60,6 +60,9 @@ module EE
next if file_type == "dependency_scanning" &&
::Feature.disabled?(:parse_dependency_scanning_reports, default_enabled: true)
next if file_type == "container_scanning" &&
::Feature.disabled?(:parse_container_scanning_reports, default_enabled: true)
security_reports.get_report(file_type).tap do |security_report|
begin
next unless project.feature_available?(LICENSED_PARSER_FEATURES.fetch(file_type))
......
......@@ -203,6 +203,20 @@ describe Ci::Build do
end
end
context 'when Feature flag is disabled for Container Scanning reports parsing' do
before do
stub_feature_flags(parse_container_scanning_reports: false)
create(:ee_ci_job_artifact, :sast, job: job, project: job.project)
create(:ee_ci_job_artifact, :container_scanning, job: job, project: job.project)
end
it 'does NOT parse container scanning report' do
subject
expect(security_reports.reports.keys).to contain_exactly('sast')
end
end
context 'when there is a corrupted sast report' do
before do
create(:ee_ci_job_artifact, :sast_with_corrupted_data, job: job, project: job.project)
......
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