Skip to content

Migrate elastic search warning

Diana Zubova requested to merge dz/354594-migrate-elastic-search-warning into master

What does this MR do and why?

Update ee/app/views/admin/application_settings/_elasticsearch_form.html.haml to leverage the shared alert HAML partial (app/views/shared/_global_alert.html.haml).

Related to #354594 (closed)

Screenshots or screen recordings

No visual change

Screenshot_2022-03-15_at_11.07.49

How to set up and validate locally

  1. Apply the following patch (it's the fastest way to emulate halted migration)
Click to expand
diff --git a/ee/app/services/elastic/data_migration_service.rb b/ee/app/services/elastic/data_migration_service.rb
index 718f3c3f325..07d1f6a29b9 100644
--- a/ee/app/services/elastic/data_migration_service.rb
+++ b/ee/app/services/elastic/data_migration_service.rb
@@ -81,12 +81,14 @@ def pending_migrations
       end
 
       def halted_migrations?
+        return true
         migrations.reverse.any? do |migration|
           migration_halted?(migration)
         end
       end
 
       def halted_migration
+        return migrations.first
         migrations.reverse.find do |migration|
           migration_halted?(migration)
         end
diff --git a/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml b/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
index da32afb9a74..a90a02f485d 100644
--- a/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
+++ b/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
@@ -1,7 +1,7 @@
 - return unless License.feature_available?(:elastic_search)
 
 - elastic_helper = Gitlab::Elastic::Helper.default
-- elasticsearch_available = elastic_helper.ping?
+- elasticsearch_available = true
 
 %section.settings.as-elasticsearch.no-animate#js-elasticsearch-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'elasticsearch_tab' } }
   .settings-header
1. Login as admin 1. Visit `Advanced search` settings `http://localhost:3000/admin/application_settings/advanced_search` and click `Expand`

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Diana Zubova

Merge request reports

Loading