Commit be203210 authored by Pavel Shutsin's avatar Pavel Shutsin

Merge branch 'ff-vulnerability_location_image_filter-remove' into 'master'

Remove vulnerability_location_image_filter feature flag

See merge request gitlab-org/gitlab!76298
parents 4e5f8303 a9a8fde6
---
name: vulnerability_location_image_filter
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69867
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/340915
milestone: '14.4'
type: development
group: group::container security
default_enabled: true
......@@ -99,7 +99,7 @@ module Security
# This filter will not work for InstanceSecurityDashboard, because InstanceSecurityDashboard could have multiple projects.
return if vulnerable.is_a?(InstanceSecurityDashboard)
if params[:image].present? && Feature.enabled?(:vulnerability_location_image_filter, vulnerable, default_enabled: :yaml)
if params[:image].present?
@vulnerabilities = vulnerabilities.with_container_image(params[:image])
end
end
......
......@@ -165,29 +165,15 @@ RSpec.describe Security::VulnerabilitiesFinder do
let(:filters) { { image: [finding.location['image']] } }
let(:feature_enabled) { true }
before do
stub_feature_flags(vulnerability_location_image_filter: feature_enabled)
end
context 'when vulnerability_location_image_filter is disabled' do
let(:feature_enabled) { false }
it 'does not include cluster vulnerability' do
is_expected.not_to contain_exactly(cluster_vulnerability)
end
it 'only returns vulnerabilities matching the given image' do
is_expected.to contain_exactly(cluster_vulnerability)
end
context 'when vulnerability_location_image_filter is enabled' do
it 'only returns vulnerabilities matching the given image' do
is_expected.to contain_exactly(cluster_vulnerability)
end
context 'when different report_type is passed' do
let(:filters) { { report_type: %w[dast], image: [finding.location['image']] }}
context 'when different report_type is passed' do
let(:filters) { { report_type: %w[dast], image: [finding.location['image']] }}
it 'returns empty list' do
is_expected.to be_empty
end
it 'returns empty list' do
is_expected.to be_empty
end
end
......
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