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
ab9efefd
Commit
ab9efefd
authored
Mar 15, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support to enqueue wiki updates
parent
ad3bbe30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
app/services/geo/enqueue_wiki_update_service.rb
app/services/geo/enqueue_wiki_update_service.rb
+14
-0
lib/gitlab/geo.rb
lib/gitlab/geo.rb
+4
-0
spec/services/geo/enqueue_project_update_service_spec.rb
spec/services/geo/enqueue_project_update_service_spec.rb
+0
-0
spec/services/geo/enqueue_wiki_update_service_spec.rb
spec/services/geo/enqueue_wiki_update_service_spec.rb
+31
-0
No files found.
app/services/geo/enqueue_wiki_update_service.rb
0 → 100644
View file @
ab9efefd
module
Geo
class
EnqueueWikiUpdateService
attr_reader
:project
def
initialize
(
project
)
@queue
=
Gitlab
::
Geo
::
UpdateQueue
.
new
(
'updated_wikis'
)
@project
=
project
end
def
execute
@queue
.
store
({
id:
@project
.
id
,
clone_url:
@project
.
wiki
.
url_to_repo
})
end
end
end
lib/gitlab/geo.rb
View file @
ab9efefd
...
...
@@ -38,6 +38,10 @@ module Gitlab
::
Geo
::
EnqueueProjectUpdateService
.
new
(
project
).
execute
end
def
self
.
notify_wiki_update
(
project
)
::
Geo
::
EnqueueWikiUpdateService
.
new
(
project
).
execute
end
def
self
.
bulk_notify_job
Sidekiq
::
Cron
::
Job
.
find
(
'geo_bulk_notify_worker'
)
end
...
...
spec/services/geo/enqueue_update_service_spec.rb
→
spec/services/geo/enqueue_
project_
update_service_spec.rb
View file @
ab9efefd
File moved
spec/services/geo/enqueue_wiki_update_service_spec.rb
0 → 100644
View file @
ab9efefd
describe
Geo
::
EnqueueWikiUpdateService
,
service:
true
do
subject
{
Geo
::
EnqueueWikiUpdateService
.
new
(
project
)
}
let
(
:project
)
{
double
(
:project
)
}
let
(
:fake_url
)
{
'git@localhost:repo/path.git'
}
let
(
:fake_id
)
{
999
}
let
(
:queue
)
{
subject
.
instance_variable_get
(
:@queue
)
}
before
(
:each
)
do
queue
.
empty!
expect
(
project
).
to
receive_message_chain
(
:wiki
,
:url_to_repo
)
{
fake_url
}
expect
(
project
).
to
receive
(
:id
)
{
fake_id
}
end
describe
'#execute'
do
let
(
:stored_data
)
{
queue
.
first
}
before
(
:each
)
{
subject
.
execute
}
it
'persists id and clone_url to redis queue'
do
expect
(
stored_data
).
to
have_key
(
'id'
)
expect
(
stored_data
).
to
have_key
(
'clone_url'
)
end
it
'persisted id is equal to original'
do
expect
(
stored_data
[
'id'
]).
to
eq
(
fake_id
)
end
it
'persisted clone_url is equal to original'
do
expect
(
stored_data
[
'clone_url'
]).
to
eq
(
fake_url
)
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