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
744cb678
Commit
744cb678
authored
Jun 29, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log renamed event to the Geo event log when repository is transferred
parent
5a2581d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
app/services/ee/projects/transfer_service.rb
app/services/ee/projects/transfer_service.rb
+16
-0
app/services/projects/transfer_service.rb
app/services/projects/transfer_service.rb
+2
-0
spec/services/ee/projects/transfer_service_spec.rb
spec/services/ee/projects/transfer_service_spec.rb
+22
-0
No files found.
app/services/ee/projects/transfer_service.rb
0 → 100644
View file @
744cb678
module
EE
module
Projects
module
TransferService
private
def
execute_system_hooks
raise
NotImplementedError
unless
defined?
(
super
)
super
::
Geo
::
RepositoryRenamedEventStore
.
new
(
project
,
old_path:
project
.
path
,
old_path_with_namespace:
@old_path
).
create
end
end
end
end
app/services/projects/transfer_service.rb
View file @
744cb678
...
...
@@ -11,6 +11,8 @@ module Projects
include
Gitlab
::
ShellAdapter
TransferError
=
Class
.
new
(
StandardError
)
prepend
::
EE
::
Projects
::
TransferService
def
execute
(
new_namespace
)
@new_namespace
=
new_namespace
...
...
spec/services/ee/projects/transfer_service_spec.rb
0 → 100644
View file @
744cb678
# rubocop:disable RSpec/FilePath
require
'spec_helper'
describe
Projects
::
TransferService
,
services:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
subject
{
described_class
.
new
(
project
,
user
)
}
before
do
group
.
add_owner
(
user
)
end
context
'when running on a primary node'
do
let!
(
:geo_node
)
{
create
(
:geo_node
,
:primary
,
:current
)
}
it
'logs an event to the Geo event log'
do
expect
{
subject
.
execute
(
group
)
}.
to
change
(
Geo
::
RepositoryRenamedEvent
,
:count
).
by
(
1
)
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