Skip to content

DeleteObsoleteAdvancedSearchMigrations ignore missing spec files

What does this MR do and why?

The ee/elastic/migrate/20230519142363_add_ci_catalog_to_project.rb migration does not have a corresponding spec file which causes this keep to blow up. This MR adds a check that the spec file exists before trying to delete it and add it to the merge request.

I've run the updated keep to create !155116 (merged) successfully

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. delete a spec file from an obsolete advanced search migration
  2. run the keep in dry run mode
      bundle exec gitlab-housekeeper --target-branch=master -m 1 -k Keeps::DeleteObsoleteAdvancedSearchMigrations --dry-run
  3. verify it reports that 1 MR would have been created
Click to expand end of the output of dry run
diff --git a/ee/spec/elastic/migrate/20230908161822_reindex_work_item_to_fix_label_ids_spec.rb b/ee/spec/elastic/migrate/20230908161822_reindex_work_item_to_fix_label_ids_spec.rb
deleted file mode 100644
index 5bfe4b6a3a51..000000000000
--- a/ee/spec/elastic/migrate/20230908161822_reindex_work_item_to_fix_label_ids_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require File.expand_path('ee/elastic/migrate/20230908161822_reindex_work_item_to_fix_label_ids.rb')
-
-RSpec.describe ReindexWorkItemToFixLabelIds, feature_category: :global_search do
-  it_behaves_like 'a deprecated Advanced Search migration', 20230908161822
-end
diff --git a/ee/spec/elastic/migrate/20231213182444_remove_epics_based_on_schema_version_spec.rb b/ee/spec/elastic/migrate/20231213182444_remove_epics_based_on_schema_version_spec.rb
deleted file mode 100644
index c3e5cb3cbd2a..000000000000
--- a/ee/spec/elastic/migrate/20231213182444_remove_epics_based_on_schema_version_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require File.expand_path('ee/elastic/migrate/20231213182444_remove_epics_based_on_schema_version.rb')
-
-RSpec.describe RemoveEpicsBasedOnSchemaVersion, feature_category: :global_search do
-  it_behaves_like 'a deprecated Advanced Search migration', 20231213182444
-end


Dry run complete. Housekeeper would have created 1 MR on an actual run.
Edited by Terri Chu

Merge request reports