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
bdd25de6
Commit
bdd25de6
authored
Jul 10, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement progressive elasticsearch indexing for project mirrors
parent
9f2608ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
app/models/ee/project/import_status_state_machine.rb
app/models/ee/project/import_status_state_machine.rb
+4
-1
changelogs/unreleased-ee/2881-es-progessive-indexing-of-mirrors.yml
.../unreleased-ee/2881-es-progessive-indexing-of-mirrors.yml
+4
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+40
-0
No files found.
app/models/ee/project/import_status_state_machine.rb
View file @
bdd25de6
...
...
@@ -47,7 +47,10 @@ module EE
end
if
current_application_settings
.
elasticsearch_indexing?
project
.
run_after_commit
{
ElasticCommitIndexerWorker
.
perform_async
(
project
.
id
)
}
project
.
run_after_commit
do
last_indexed_commit
=
project
.
index_status
&
.
last_commit
ElasticCommitIndexerWorker
.
perform_async
(
project
.
id
,
last_indexed_commit
)
end
end
end
...
...
changelogs/unreleased-ee/2881-es-progessive-indexing-of-mirrors.yml
0 → 100644
View file @
bdd25de6
---
title
:
Implement progressive elasticsearch indexing for project mirrors
merge_request
:
2393
author
:
spec/models/project_spec.rb
View file @
bdd25de6
...
...
@@ -1824,6 +1824,46 @@ describe Project, models: true do
expect
(
housekeeping_service
).
not_to
have_received
(
:execute
)
end
context
'elasticsearch indexing disabled'
do
before
do
stub_application_setting
(
elasticsearch_indexing:
false
)
end
it
'does not index the repository'
do
project
=
create
(
:empty_project
,
:import_started
,
import_type: :github
)
expect
(
ElasticCommitIndexerWorker
).
not_to
receive
(
:perform_async
)
project
.
import_finish
end
end
context
'elasticsearch indexing enabled'
do
let
(
:project
)
{
create
(
:project
,
:import_started
,
import_type: :github
)
}
before
do
stub_application_setting
(
elasticsearch_indexing:
true
)
end
context
'no index status'
do
it
'schedules a full index of the repository'
do
expect
(
ElasticCommitIndexerWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
nil
)
project
.
import_finish
end
end
context
'with index status'
do
let!
(
:index_status
)
{
project
.
create_index_status!
(
indexed_at:
Time
.
now
,
last_commit:
'foo'
)
}
it
'schedules a progressive index of the repository'
do
expect
(
ElasticCommitIndexerWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
index_status
.
last_commit
)
project
.
import_finish
end
end
end
end
end
...
...
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