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
1d209416
Commit
1d209416
authored
Feb 23, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Elastic] Update index on push to wiki
parent
8de3358b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
CHANGELOG-EE
CHANGELOG-EE
+3
-0
app/workers/post_receive.rb
app/workers/post_receive.rb
+12
-0
spec/workers/post_receive_spec.rb
spec/workers/post_receive_spec.rb
+10
-0
No files found.
CHANGELOG-EE
View file @
1d209416
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 8.6.0
- [Elastic] Update index on push to wiki
v 8.5.0 (unreleased)
v 8.5.0 (unreleased)
- Show warning when mirror repository default branch could not be updated because it has diverged from upstream.
- Show warning when mirror repository default branch could not be updated because it has diverged from upstream.
- More reliable wiki indexer
- More reliable wiki indexer
...
...
app/workers/post_receive.rb
View file @
1d209416
...
@@ -14,6 +14,18 @@ class PostReceive
...
@@ -14,6 +14,18 @@ class PostReceive
repo_path
.
gsub!
(
/\.git\z/
,
""
)
repo_path
.
gsub!
(
/\.git\z/
,
""
)
repo_path
.
gsub!
(
/\A\//
,
""
)
repo_path
.
gsub!
(
/\A\//
,
""
)
if
repo_path
=~
/wiki\z/
&&
Gitlab
.
config
.
elasticsearch
.
enabled
repo_path
.
gsub!
(
/\.wiki\z/
,
""
)
project
=
Project
.
find_with_namespace
(
repo_path
)
if
project
project
.
wiki
.
index_blobs
end
return
false
end
project
=
Project
.
find_with_namespace
(
repo_path
)
project
=
Project
.
find_with_namespace
(
repo_path
)
if
project
.
nil?
if
project
.
nil?
...
...
spec/workers/post_receive_spec.rb
View file @
1d209416
...
@@ -21,6 +21,16 @@ describe PostReceive do
...
@@ -21,6 +21,16 @@ describe PostReceive do
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
base64_changes
)
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
base64_changes
)
end
end
it
"triggers wiki index update"
do
allow
(
Gitlab
.
config
.
elasticsearch
).
to
receive
(
:enabled
).
and_return
(
true
)
expect
(
Project
).
to
receive
(
:find_with_namespace
).
with
(
project
.
path_with_namespace
).
and_return
(
project
)
expect_any_instance_of
(
ProjectWiki
).
to
receive
(
:index_blobs
)
repo_path
=
"
#{
pwd
(
project
)
}
.wiki"
PostReceive
.
new
.
perform
(
repo_path
,
key_id
,
base64_changes
)
end
it
"does not run if the author is not in the project"
do
it
"does not run if the author is not in the project"
do
allow
(
Key
).
to
receive
(
:find_by
).
with
(
hash_including
(
id:
anything
()))
{
nil
}
allow
(
Key
).
to
receive
(
:find_by
).
with
(
hash_including
(
id:
anything
()))
{
nil
}
...
...
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