From c18ba963d57e019dabd5b837327f5fbedfa21fb6 Mon Sep 17 00:00:00 2001 From: GitLab Housekeeping Bot Date: Sat, 18 Oct 2025 00:43:30 +0000 Subject: [PATCH 1/5] Mark 20250702131958 as obsolete This migration marks the 20250702131958 BackfillReachabilityInVulnerabilities Advanced search migration as obsolete. [Search for references to `backfill_reachability_in_vulnerabilities` in code](https://gitlab.com/search?project_id=278964&scope=blobs&search=backfill_reachability_in_vulnerabilities®ex=false)) At the moment, the `gitlab-housekeeper` is not always capable of removing all references so you must check the diff and pipeline failures to confirm if there are any issues. It is the responsibility of the assignee (picked from ~"group::global search") to push those changes to this branch. [Read more](https://docs.gitlab.com/ee/development/search/advanced_search_migration_styleguide.html#cleaning-up-advanced-search-migrations) about the process for marking Advanced search migrations as obsolete. All Advanced search migrations must have had at least one [required stop](https : // docs.gitlab.com / ee / development / database / required_stops.html) to process the migration. Therefore we mark any Advanced search migrations added before the last required stop as obsolete. This change was generated by [gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper) in [CI](https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/jobs/11762011156) using the `Keeps::MarkOldAdvancedSearchMigrationsAsObsolete` keep. To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the label ~"GitLab Housekeeper" and consider pinging the author of this keep. Changelog: other EE: true --- ...8_backfill_reachability_in_vulnerabilities.yml | 15 +++++++-------- ...58_backfill_reachability_in_vulnerabilities.rb | 2 ++ ...ckfill_reachability_in_vulnerabilities_spec.rb | 13 ++----------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml index 2cd01771e4db99..c0c8db70789ee5 100644 --- a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml +++ b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml @@ -5,12 +5,11 @@ 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: +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. +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. diff --git a/ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb b/ee/elastic/migrate/20250702131958_backfill_reachability_in_vulnerabilities.rb index d4b86e92081737..98cc5a3f77ec70 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 0f19f963bd877d..b38b88452a8855 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 -- GitLab From e1ce69abe79967242d54dac781eb51fc2c7ff82c Mon Sep 17 00:00:00 2001 From: Changzheng Liu Date: Mon, 20 Oct 2025 13:43:19 -0700 Subject: [PATCH 2/5] Apply 1 suggestion(s) to 1 file(s) --- .../20250702131958_backfill_reachability_in_vulnerabilities.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml index c0c8db70789ee5..766001a9fd6543 100644 --- a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml +++ b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml @@ -6,7 +6,7 @@ group: group::security infrastructure milestone: '18.3' introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/198141 obsolete: true -marked_obsolete_by_url: +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 -- GitLab From 190ddcebb223e655aace9662801a5377481b5ad0 Mon Sep 17 00:00:00 2001 From: Changzheng Liu Date: Tue, 21 Oct 2025 11:34:05 -0700 Subject: [PATCH 3/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: GitLab Duo --- ...20250702131958_backfill_reachability_in_vulnerabilities.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml index 766001a9fd6543..01c27c746dee82 100644 --- a/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml +++ b/ee/elastic/docs/20250702131958_backfill_reachability_in_vulnerabilities.yml @@ -9,7 +9,8 @@ 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 +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. -- GitLab From 91c685bc6a14b30770e0dd5530fb34919c40a00f Mon Sep 17 00:00:00 2001 From: Changzheng Liu Date: Tue, 21 Oct 2025 15:04:49 -0700 Subject: [PATCH 4/5] Remove the code related to the data migration --- .../graphql/resolvers/vulnerability_filterable.rb | 5 +---- .../vulnerability_filterable_shared_examples.rb | 14 -------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/ee/app/graphql/resolvers/vulnerability_filterable.rb b/ee/app/graphql/resolvers/vulnerability_filterable.rb index 672a1f1efe5177..6cecd845b70075 100644 --- a/ee/app/graphql/resolvers/vulnerability_filterable.rb +++ b/ee/app/graphql/resolvers/vulnerability_filterable.rb @@ -63,10 +63,7 @@ def use_elasticsearch?(filters) 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 valid_vulnerable raise ::Gitlab::Graphql::Errors::ArgumentError, 'The \'reachability\' argument is not currently supported on security center dashboard or ' \ 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 b5bf249009f750..e72c1bb7a2cd3c 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] } } -- GitLab From f12cdfb81d90616f5f576bbf2cda8e783d846c1a Mon Sep 17 00:00:00 2001 From: Changzheng Liu Date: Wed, 22 Oct 2025 10:09:14 -0700 Subject: [PATCH 5/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Terri Chu --- ee/app/graphql/resolvers/vulnerability_filterable.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ee/app/graphql/resolvers/vulnerability_filterable.rb b/ee/app/graphql/resolvers/vulnerability_filterable.rb index 6cecd845b70075..571eb6cf58c3b4 100644 --- a/ee/app/graphql/resolvers/vulnerability_filterable.rb +++ b/ee/app/graphql/resolvers/vulnerability_filterable.rb @@ -61,13 +61,10 @@ def use_elasticsearch?(filters) end def validate_reachability!(vulnerable) - valid_vulnerable = vulnerable.is_a?(Project) || vulnerable.is_a?(Group) - - return if valid_vulnerable + 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) -- GitLab