Commit e9b7e379 authored by Mike Greiling's avatar Mike Greiling

Merge branch '12712-enable-start-indexing-button' into 'master'

Enable ES web indexing by default

See merge request gitlab-org/gitlab-ee!15390
parents 2de1a3fb d9baa567
...@@ -4,7 +4,7 @@ class Admin::ElasticsearchController < Admin::ApplicationController ...@@ -4,7 +4,7 @@ class Admin::ElasticsearchController < Admin::ApplicationController
before_action :check_elasticsearch_web_indexing_feature_flag! before_action :check_elasticsearch_web_indexing_feature_flag!
def check_elasticsearch_web_indexing_feature_flag! def check_elasticsearch_web_indexing_feature_flag!
render_404 unless Feature.enabled?(:elasticsearch_web_indexing) render_404 unless Feature.enabled?(:elasticsearch_web_indexing, default_enabled: true)
end end
# POST # POST
...@@ -16,6 +16,6 @@ class Admin::ElasticsearchController < Admin::ApplicationController ...@@ -16,6 +16,6 @@ class Admin::ElasticsearchController < Admin::ApplicationController
queue_link = helpers.link_to(_('(check progress)'), sidekiq_path + '/queues/elastic_full_index') queue_link = helpers.link_to(_('(check progress)'), sidekiq_path + '/queues/elastic_full_index')
flash[:notice] = "#{notice} #{queue_link}".html_safe flash[:notice] = "#{notice} #{queue_link}".html_safe
redirect_back_or_default redirect_to integrations_admin_application_settings_path(anchor: 'js-elasticsearch-settings')
end end
end end
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
= f.label :elasticsearch_indexing, class: 'form-check-label' do = f.label :elasticsearch_indexing, class: 'form-check-label' do
Elasticsearch indexing Elasticsearch indexing
- if Feature.enabled?(:elasticsearch_web_indexing, default_enabled: true) && Gitlab::CurrentSettings.elasticsearch_indexing?
.form-text
= link_to _('Index all projects'), admin_elasticsearch_enqueue_index_path,
class: 'btn btn-success', method: :post
- missing = !Gitlab::Elastic::Indexer.experimental_indexer_present? - missing = !Gitlab::Elastic::Indexer.experimental_indexer_present?
.form-group .form-group
.form-check .form-check
...@@ -44,7 +49,7 @@ ...@@ -44,7 +49,7 @@
= f.label :elasticsearch_url, 'URL', class: 'label-bold' = f.label :elasticsearch_url, 'URL', class: 'label-bold'
= f.text_field :elasticsearch_url, value: @application_setting.elasticsearch_url.join(', '), class: 'form-control', placeholder: 'http://localhost:9200', data: { qa_selector: 'url_field' } = f.text_field :elasticsearch_url, value: @application_setting.elasticsearch_url.join(', '), class: 'form-control', placeholder: 'http://localhost:9200', data: { qa_selector: 'url_field' }
.form-text.text-muted .form-text.text-muted
The url to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., "http://localhost:9200, http://localhost:9201"). The URL to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., "http://localhost:9200, http://localhost:9201").
.form-group .form-group
= f.label :elasticsearch_shards, _('Number of Elasticsearch shards'), class: 'label-bold' = f.label :elasticsearch_shards, _('Number of Elasticsearch shards'), class: 'label-bold'
...@@ -102,11 +107,3 @@ ...@@ -102,11 +107,3 @@
AWS Secret Access Key. Only required if not using role instance credentials AWS Secret Access Key. Only required if not using role instance credentials
= f.submit 'Save changes', class: "btn btn-success", data: { qa_selector: 'submit_button' } = f.submit 'Save changes', class: "btn btn-success", data: { qa_selector: 'submit_button' }
- if Feature.enabled?(:elasticsearch_web_indexing)
%br
%h4
= _('Indexing')
= form_with url: admin_elasticsearch_enqueue_index_path, html: { class: 'fieldset-form' }, data: { remote: false } do |f|
= f.submit _('Start Indexing'), class: "btn btn-success"
...@@ -18,9 +18,10 @@ describe Admin::ElasticsearchController do ...@@ -18,9 +18,10 @@ describe Admin::ElasticsearchController do
post :enqueue_index post :enqueue_index
expect(controller).to set_flash[:notice].to include('/admin/sidekiq/queues/elastic_full_index') expect(controller).to set_flash[:notice].to include('/admin/sidekiq/queues/elastic_full_index')
expect(response).to redirect_to integrations_admin_application_settings_path(anchor: 'js-elasticsearch-settings')
end end
context 'when feature disabled' do context 'when feature is disabled' do
it 'does nothing and returns 404' do it 'does nothing and returns 404' do
stub_feature_flags(elasticsearch_web_indexing: false) stub_feature_flags(elasticsearch_web_indexing: false)
......
...@@ -8171,7 +8171,7 @@ msgstr "" ...@@ -8171,7 +8171,7 @@ msgstr ""
msgid "Incompatible options set!" msgid "Incompatible options set!"
msgstr "" msgstr ""
msgid "Indexing" msgid "Index all projects"
msgstr "" msgstr ""
msgid "Indicates whether this runner can pick jobs without tags" msgid "Indicates whether this runner can pick jobs without tags"
...@@ -14357,9 +14357,6 @@ msgstr "" ...@@ -14357,9 +14357,6 @@ msgstr ""
msgid "Start GitLab Ultimate trial" msgid "Start GitLab Ultimate trial"
msgstr "" msgstr ""
msgid "Start Indexing"
msgstr ""
msgid "Start Web Terminal" msgid "Start Web Terminal"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment