Commit 2e3b4da9 authored by Robert Speicher's avatar Robert Speicher

Merge branch '6718_add_feature_flag' into 'master'

Add feature flag for Dependency Scanning reports parsing

See merge request gitlab-org/gitlab-ee!8760
parents 78ee27fa 691f11b1
......@@ -47,6 +47,9 @@ module EE
def collect_security_reports!(security_reports)
each_report(::Ci::JobArtifact::SECURITY_REPORT_FILE_TYPES) do |file_type, blob|
next if file_type == "dependency_scanning" &&
::Feature.disabled?(:parse_dependency_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))
......
......@@ -185,6 +185,20 @@ describe Ci::Build do
end
end
context 'when Feature flag is disabled for Dependency Scanning reports parsing' do
before do
stub_feature_flags(parse_dependency_scanning_reports: false)
create(:ee_ci_job_artifact, :sast, job: job, project: job.project)
create(:ee_ci_job_artifact, :dependency_scanning, job: job, project: job.project)
end
it 'does NOT parse dependency 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