diff --git a/ee/app/graphql/resolvers/vulnerability_filterable.rb b/ee/app/graphql/resolvers/vulnerability_filterable.rb index 672a1f1efe517790330f0e484428e698cc0d2b9d..571eb6cf58c3b469be595e4bbe9f86d19b5839b1 100644 --- a/ee/app/graphql/resolvers/vulnerability_filterable.rb +++ b/ee/app/graphql/resolvers/vulnerability_filterable.rb @@ -61,16 +61,10 @@ def use_elasticsearch?(filters) end def validate_reachability!(vulnerable) - valid_vulnerable = vulnerable.is_a?(Project) || vulnerable.is_a?(Group) - - es_migration_completed = ::Elastic::DataMigrationService - .migration_has_finished?(:backfill_reachability_in_vulnerabilities) - - return if valid_vulnerable && es_migration_completed + return if vulnerable.is_a?(Project) || vulnerable.is_a?(Group) raise ::Gitlab::Graphql::Errors::ArgumentError, - 'The \'reachability\' argument is not currently supported on security center dashboard or ' \ - 'the required migrations are not completed.' + 'The \'reachability\' argument is not currently supported on security center dashboard.' end def validate_validity_check!(vulnerable) diff --git a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml index 2cd01771e4db9958915494e3450c05ed36f82933..01c27c746dee8234ba25f664af7eacc98b0c8ce7 100644 --- a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml +++ b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml @@ -5,12 +5,12 @@ description: Backfills Vulnerabilities Index from PostgreSQL to backfill reachab group: group::security infrastructure milestone: '18.3' introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/198141 -obsolete: false -marked_obsolete_by_url: -marked_obsolete_in_milestone: +obsolete: true +marked_obsolete_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/209384 +marked_obsolete_in_milestone: '18.6' skippable: true skip_condition: >- - This migration will run on SaaS and Dedicated GitLab instances. - For Self-managed instances decision is awaited and is tracked in - https://gitlab.com/gitlab-org/gitlab/-/issues/525484. - For Self-managed this migration will be skipped and can be introduced later based on product direction. + This migration will run on SaaS and Dedicated GitLab instances. For + Self-managed instances decision is awaited and is tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/525484. + For Self-managed this migration will be skipped and can be introduced later based + on product direction. diff --git a/ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb b/ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb index d4b86e92081737a2395094d6c9bcadf57ee69f13..98cc5a3f77ec7071f182aaa67302b4abc86c868e 100644 --- a/ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb +++ b/ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb @@ -37,3 +37,5 @@ def dedicated_with_es? delegate :sass_with_es?, :dedicated_with_es?, to: :class end + +BackfillReachabilityInVulnerabilities.prepend ::Search::Elastic::MigrationObsolete diff --git a/ee/spec/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities_spec.rb b/ee/spec/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities_spec.rb index 0f19f963bd877d696c352b4f94a6edb7b0313558..b38b88452a88552d21b2125f8964577afb658627 100644 --- a/ee/spec/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities_spec.rb +++ b/ee/spec/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities_spec.rb @@ -3,15 +3,6 @@ require 'spec_helper' require File.expand_path('ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb') -RSpec.describe BackfillReachabilityInVulnerabilities, feature_category: :vulnerability_management do - let(:version) { 20250702131958 } - - describe 'migration', :elastic do - it_behaves_like 'migration reindexes all data' do - let(:objects) { create_list(:vulnerability_read, 3) } - let(:factory_to_create_objects) { :vulnerability_read } - let(:expected_throttle_delay) { 30.seconds } - let(:expected_batch_size) { 30_000 } - end - end +RSpec.describe BackfillReachabilityInVulnerabilities, feature_category: :global_search do + it_behaves_like 'a deprecated Advanced Search migration', 20250702131958 end diff --git a/ee/spec/support/shared_examples/graphql/resolvers/vulnerability_filterable_shared_examples.rb b/ee/spec/support/shared_examples/graphql/resolvers/vulnerability_filterable_shared_examples.rb index b5bf249009f75081b6061c7a7fea715dd2238a47..e72c1bb7a2cd3c4375549cbadc09b0e07d57a63d 100644 --- a/ee/spec/support/shared_examples/graphql/resolvers/vulnerability_filterable_shared_examples.rb +++ b/ee/spec/support/shared_examples/graphql/resolvers/vulnerability_filterable_shared_examples.rb @@ -31,20 +31,6 @@ end end - context 'with reachability' do - let(filter_key) { { reachability: 'IN_USE' } } - - before do - set_elasticsearch_migration_to(:backfill_reachability_in_vulnerabilities, including: false) - end - - it 'raises an ArgumentError' do - expect_graphql_error_to_be_created(Gitlab::Graphql::Errors::ArgumentError) do - subject - end - end - end - context 'with validity_check' do let(filter_key) { { validity_check: [Security::FindingTokenStatus.statuses.each_key.first.upcase] } }