Mark 20260515123343 as obsolete
This migration marks the 20260515123343 ReindexUserToFixUsernameAndNameAnalyzers Advanced search migration as obsolete.
Automated Changes
This MR includes automated changes made by AI to remove references to the obsolete migration:
- Migration file: Updated to prepend
::Search::Elastic::MigrationObsolete - YAML documentation: Added
obsolete: trueandmarked_obsolete_in_milestone - Spec file: Updated to use
it_behaves_like 'a deprecated Advanced Search migration' - Code references: AI attempted to find and remove/simplify references to this migration throughout the codebase
Critical Pattern: migration_has_finished? Checks
When a migration is obsolete, ::Elastic::DataMigrationService.migration_has_finished?(:reindex_user_to_fix_username_and_name_analyzers) always returns true.
The AI has attempted to simplify conditionals and remove dead code branches:
if migration_has_finished?(:reindex_user_to_fix_username_and_name_analyzers)- kept the if branch, removed else branchunless migration_has_finished?(:reindex_user_to_fix_username_and_name_analyzers)- removed entire block (never executes)- Combined conditions like
feature_flag && migration_has_finished?(:reindex_user_to_fix_username_and_name_analyzers)- simplified to justfeature_flag - Test stubs returning
false- removed tests for scenarios that can no longer occur
Review Checklist
- Verify all
migration_has_finished?(:reindex_user_to_fix_username_and_name_analyzers)checks have been removed or simplified - Confirm that simplified logic maintains the same behavior (the "if finished" branch is now always taken)
- Check for any remaining references to
ReindexUserToFixUsernameAndNameAnalyzers(class name) orreindex_user_to_fix_username_and_name_analyzers(snake_case) - Review test coverage to ensure meaningful tests remain after removing obsolete scenarios
- Verify CI passes with all changes
Search for Remaining References
- Search for class name:
ReindexUserToFixUsernameAndNameAnalyzers - Search for snake_case name:
reindex_user_to_fix_username_and_name_analyzers - Search for migration check:
migration_has_finished?(:reindex_user_to_fix_username_and_name_analyzers)
Additional Notes
At the moment, the gitlab-housekeeper AI integration 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 to push those changes to this branch if needed.
Read more about the process for marking Advanced search migrations as obsolete.
All Advanced search migrations must have had at least one required stop 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
in CI 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.