Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d82412f4
Commit
d82412f4
authored
May 01, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add web UI to trigger full indexing
Indexing done in background job
parent
5603e23a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
0 deletions
+85
-0
ee/app/controllers/admin/elasticsearch_controller.rb
ee/app/controllers/admin/elasticsearch_controller.rb
+21
-0
ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
.../admin/application_settings/_elasticsearch_form.html.haml
+8
-0
ee/changelogs/unreleased/5299-elastic-recovery.yml
ee/changelogs/unreleased/5299-elastic-recovery.yml
+5
-0
ee/config/routes/admin.rb
ee/config/routes/admin.rb
+4
-0
ee/spec/controllers/admin/elasticsearch_controller_spec.rb
ee/spec/controllers/admin/elasticsearch_controller_spec.rb
+35
-0
locale/gitlab.pot
locale/gitlab.pot
+12
-0
No files found.
ee/app/controllers/admin/elasticsearch_controller.rb
0 → 100644
View file @
d82412f4
# frozen_string_literal: true
class
Admin::ElasticsearchController
<
Admin
::
ApplicationController
before_action
:check_elasticsearch_web_indexing_feature_flag!
def
check_elasticsearch_web_indexing_feature_flag!
render_404
unless
Feature
.
enabled?
(
:elasticsearch_web_indexing
)
end
# POST
# Scheduling indexing jobs
def
enqueue_index
::
Elastic
::
IndexProjectsService
.
new
.
execute
notice
=
_
(
'Elasticsearch indexing started'
)
queue_link
=
helpers
.
link_to
(
_
(
'(check progress)'
),
sidekiq_path
+
'/queues/elastic_full_index'
)
flash
[
:notice
]
=
"
#{
notice
}
#{
queue_link
}
"
.
html_safe
redirect_back_or_default
end
end
ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
View file @
d82412f4
...
...
@@ -82,3 +82,11 @@
AWS Secret Access Key. Only required if not using role instance credentials
=
f
.
submit
'Save changes'
,
class:
"btn btn-success"
-
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"
ee/changelogs/unreleased/5299-elastic-recovery.yml
0 → 100644
View file @
d82412f4
---
title
:
Allowing Elasticsearch indexing gap recovering
merge_request
:
11408
author
:
type
:
changed
ee/config/routes/admin.rb
View file @
d82412f4
...
...
@@ -44,5 +44,9 @@ namespace :admin do
resources
:uploads
,
only:
[
:index
,
:destroy
]
end
namespace
:elasticsearch
do
post
:enqueue_index
end
get
'/dashboard/stats'
,
to:
'dashboard#stats'
end
ee/spec/controllers/admin/elasticsearch_controller_spec.rb
0 → 100644
View file @
d82412f4
# frozen_string_literal: true
require
'spec_helper'
describe
Admin
::
ElasticsearchController
do
let
(
:admin
)
{
create
(
:admin
)
}
describe
'POST #enqueue_index'
do
before
do
sign_in
(
admin
)
end
it
'starts indexing'
do
expect_next_instance_of
(
::
Elastic
::
IndexProjectsService
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
)
end
post
:enqueue_index
expect
(
controller
).
to
set_flash
[
:notice
].
to
include
(
'/admin/sidekiq/queues/elastic_full_index'
)
end
context
'when feature disabled'
do
it
'does nothing and returns 404'
do
stub_feature_flags
(
elasticsearch_web_indexing:
false
)
expect
(
::
Elastic
::
IndexProjectsService
).
not_to
receive
(
:new
)
post
:enqueue_index
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
end
end
end
locale/gitlab.pot
View file @
d82412f4
...
...
@@ -306,6 +306,9 @@ msgstr ""
msgid "(No changes)"
msgstr ""
msgid "(check progress)"
msgstr ""
msgid "(external source)"
msgstr ""
...
...
@@ -4271,6 +4274,9 @@ msgstr ""
msgid "Elasticsearch"
msgstr ""
msgid "Elasticsearch indexing started"
msgstr ""
msgid "Elasticsearch integration. Elasticsearch AWS IAM."
msgstr ""
...
...
@@ -6606,6 +6612,9 @@ msgstr ""
msgid "Incompatible options set!"
msgstr ""
msgid "Indexing"
msgstr ""
msgid "Indicates whether this runner can pick jobs without tags"
msgstr ""
...
...
@@ -11534,6 +11543,9 @@ msgstr ""
msgid "Start GitLab Ultimate trial"
msgstr ""
msgid "Start Indexing"
msgstr ""
msgid "Start Web Terminal"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment