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
f8af3aba
Commit
f8af3aba
authored
Jul 18, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make primary_ssh_path_prefix public
parent
11aea03f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
app/services/geo/base_sync_service.rb
app/services/geo/base_sync_service.rb
+6
-6
spec/services/geo/base_sync_service_spec.rb
spec/services/geo/base_sync_service_spec.rb
+2
-2
No files found.
app/services/geo/base_sync_service.rb
View file @
f8af3aba
...
...
@@ -29,6 +29,12 @@ module Geo
@lease_key
||=
"
#{
LEASE_KEY_PREFIX
}
:
#{
type
}
:
#{
project
.
id
}
"
end
def
primary_ssh_path_prefix
@primary_ssh_path_prefix
||=
Gitlab
::
Geo
.
primary_node
.
clone_url_prefix
.
tap
do
|
prefix
|
raise
EmptyCloneUrlPrefixError
,
'Missing clone_url_prefix in the primary node'
unless
prefix
.
present?
end
end
private
def
sync_repository
...
...
@@ -78,12 +84,6 @@ module Geo
self
.
class
.
type
end
def
primary_ssh_path_prefix
@primary_ssh_path_prefix
||=
Gitlab
::
Geo
.
primary_node
.
clone_url_prefix
.
tap
do
|
prefix
|
raise
EmptyCloneUrlPrefixError
,
'Missing clone_url_prefix in the primary node'
unless
prefix
.
present?
end
end
def
log
(
message
)
Rails
.
logger
.
info
(
"
#{
self
.
class
.
name
}
:
#{
message
}
for project
#{
project
.
path_with_namespace
}
(
#{
project
.
id
}
)"
)
end
...
...
spec/services/geo/base_sync_service_spec.rb
View file @
f8af3aba
...
...
@@ -21,11 +21,11 @@ describe Geo::BaseSyncService, services: true do
it
'raises exception when clone_url_prefix is nil'
do
allow_any_instance_of
(
GeoNode
).
to
receive
(
:clone_url_prefix
)
{
nil
}
expect
{
subject
.
send
(
:primary_ssh_path_prefix
)
}.
to
raise_error
Geo
::
EmptyCloneUrlPrefixError
expect
{
subject
.
primary_ssh_path_prefix
}.
to
raise_error
Geo
::
EmptyCloneUrlPrefixError
end
it
'returns the prefix defined in the primary node'
do
expect
(
subject
.
send
(
:primary_ssh_path_prefix
)
).
to
eq
(
'git@localhost:'
)
expect
(
subject
.
primary_ssh_path_prefix
).
to
eq
(
'git@localhost:'
)
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