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
2fc9c7be
Commit
2fc9c7be
authored
Dec 05, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo support for rewriting internal references
parent
0cf0e59f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
+51
-0
app/services/projects/cleanup_service.rb
app/services/projects/cleanup_service.rb
+2
-0
ee/app/services/ee/projects/cleanup_service.rb
ee/app/services/ee/projects/cleanup_service.rb
+14
-0
ee/spec/services/projects/cleanup_service_spec.rb
ee/spec/services/projects/cleanup_service_spec.rb
+35
-0
No files found.
app/services/projects/cleanup_service.rb
View file @
2fc9c7be
...
...
@@ -50,3 +50,5 @@ module Projects
end
end
end
::
Projects
::
CleanupService
.
prepend
(
::
EE
::
Projects
::
CleanupService
)
ee/app/services/ee/projects/cleanup_service.rb
0 → 100644
View file @
2fc9c7be
module
EE
module
Projects
module
CleanupService
extend
::
Gitlab
::
Utils
::
Override
override
:execute
def
execute
super
project
.
repository
.
log_geo_updated_event
end
end
end
end
ee/spec/services/projects/cleanup_service_spec.rb
0 → 100644
View file @
2fc9c7be
require
'spec_helper'
describe
Projects
::
CleanupService
do
include
::
EE
::
GeoHelpers
let
(
:project
)
{
create
(
:project
,
:repository
,
bfg_object_map:
fixture_file_upload
(
'spec/fixtures/bfg_object_map.txt'
))
}
let
(
:object_map
)
{
project
.
bfg_object_map
}
let
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
subject
(
:service
)
{
described_class
.
new
(
project
)
}
describe
'#execute'
do
before
do
stub_current_geo_node
(
primary
)
end
it
'sends a Geo notification about the update on success'
do
expect_next_instance_of
(
Geo
::
RepositoryUpdatedService
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
)
end
service
.
execute
end
it
'does not send a Geo notification if the update fails'
do
object_map
.
remove!
expect
(
Geo
::
RepositoryUpdatedService
).
not_to
receive
(
:new
)
expect
{
service
.
execute
}.
to
raise_error
(
/object map/
)
expect
(
Geo
::
RepositoryUpdatedEvent
.
count
).
to
eq
(
0
)
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