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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
21465dee
Commit
21465dee
authored
Jun 21, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gitaly-auth-token' into 'master'
Pass Gitaly token on Ruby gRPC requests See merge request !12228
parents
3656f6cc
218da88e
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
77 additions
and
43 deletions
+77
-43
config/gitlab.yml.example
config/gitlab.yml.example
+6
-0
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+22
-0
lib/gitlab/gitaly_client/commit.rb
lib/gitlab/gitaly_client/commit.rb
+5
-11
lib/gitlab/gitaly_client/notifications.rb
lib/gitlab/gitaly_client/notifications.rb
+7
-5
lib/gitlab/gitaly_client/ref.rb
lib/gitlab/gitaly_client/ref.rb
+10
-11
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+8
-3
lib/tasks/gitlab/gitaly.rake
lib/tasks/gitlab/gitaly.rake
+3
-2
spec/lib/gitlab/gitaly_client/commit_spec.rb
spec/lib/gitlab/gitaly_client/commit_spec.rb
+4
-4
spec/lib/gitlab/gitaly_client/notifications_spec.rb
spec/lib/gitlab/gitaly_client/notifications_spec.rb
+1
-1
spec/lib/gitlab/gitaly_client/ref_spec.rb
spec/lib/gitlab/gitaly_client/ref_spec.rb
+5
-5
spec/lib/gitlab/workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+5
-1
spec/tasks/gitlab/gitaly_rake_spec.rb
spec/tasks/gitlab/gitaly_rake_spec.rb
+1
-0
No files found.
config/gitlab.yml.example
View file @
21465dee
...
@@ -454,6 +454,10 @@ production: &base
...
@@ -454,6 +454,10 @@ production: &base
# introduced in 9.0). Eventually Gitaly use will become mandatory and
# introduced in 9.0). Eventually Gitaly use will become mandatory and
# this option will disappear.
# this option will disappear.
enabled: true
enabled: true
# Default Gitaly authentication token. Can be overriden per storage. Can
# be left blank when Gitaly is running locally on a Unix socket, which
# is the normal way to deploy Gitaly.
token:
#
#
# 4. Advanced settings
# 4. Advanced settings
...
@@ -469,6 +473,7 @@ production: &base
...
@@ -469,6 +473,7 @@ production: &base
default:
default:
path: /home/git/repositories/
path: /home/git/repositories/
gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port)
gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port)
# gitaly_token: 'special token' # Optional: override global gitaly.token for this storage.
## Backup settings
## Backup settings
backup:
backup:
...
@@ -594,6 +599,7 @@ test:
...
@@ -594,6 +599,7 @@ test:
gitaly_address: unix:tmp/tests/gitaly/gitaly.socket
gitaly_address: unix:tmp/tests/gitaly/gitaly.socket
gitaly:
gitaly:
enabled: true
enabled: true
token: secret
backup:
backup:
path: tmp/tests/backups
path: tmp/tests/backups
gitlab_shell:
gitlab_shell:
...
...
lib/gitlab/gitaly_client.rb
View file @
21465dee
require
'base64'
require
'gitaly'
require
'gitaly'
module
Gitlab
module
Gitlab
...
@@ -48,6 +50,26 @@ module Gitlab
...
@@ -48,6 +50,26 @@ module Gitlab
address
address
end
end
# All Gitaly RPC call sites should use GitalyClient.call. This method
# makes sure that per-request authentication headers are set.
def
self
.
call
(
storage
,
service
,
rpc
,
request
)
metadata
=
request_metadata
(
storage
)
metadata
=
yield
(
metadata
)
if
block_given?
stub
(
service
,
storage
).
send
(
rpc
,
request
,
metadata
)
end
def
self
.
request_metadata
(
storage
)
encoded_token
=
Base64
.
strict_encode64
(
token
(
storage
).
to_s
)
{
metadata:
{
'authorization'
=>
"Bearer
#{
encoded_token
}
"
}
}
end
def
self
.
token
(
storage
)
params
=
Gitlab
.
config
.
repositories
.
storages
[
storage
]
raise
"storage not found:
#{
storage
.
inspect
}
"
if
params
.
nil?
params
[
'gitaly_token'
].
presence
||
Gitlab
.
config
.
gitaly
[
'token'
]
end
def
self
.
enabled?
def
self
.
enabled?
Gitlab
.
config
.
gitaly
.
enabled
Gitlab
.
config
.
gitaly
.
enabled
end
end
...
...
lib/gitlab/gitaly_client/commit.rb
View file @
21465dee
...
@@ -11,28 +11,26 @@ module Gitlab
...
@@ -11,28 +11,26 @@ module Gitlab
end
end
def
is_ancestor
(
ancestor_id
,
child_id
)
def
is_ancestor
(
ancestor_id
,
child_id
)
stub
=
GitalyClient
.
stub
(
:commit
,
@repository
.
storage
)
request
=
Gitaly
::
CommitIsAncestorRequest
.
new
(
request
=
Gitaly
::
CommitIsAncestorRequest
.
new
(
repository:
@gitaly_repo
,
repository:
@gitaly_repo
,
ancestor_id:
ancestor_id
,
ancestor_id:
ancestor_id
,
child_id:
child_id
child_id:
child_id
)
)
stub
.
commit_is_ancestor
(
request
).
value
GitalyClient
.
call
(
@repository
.
storage
,
:commit
,
:commit_is_ancestor
,
request
).
value
end
end
def
diff_from_parent
(
commit
,
options
=
{})
def
diff_from_parent
(
commit
,
options
=
{})
request_params
=
commit_diff_request_params
(
commit
,
options
)
request_params
=
commit_diff_request_params
(
commit
,
options
)
request_params
[
:ignore_whitespace_change
]
=
options
.
fetch
(
:ignore_whitespace_change
,
false
)
request_params
[
:ignore_whitespace_change
]
=
options
.
fetch
(
:ignore_whitespace_change
,
false
)
request
=
Gitaly
::
CommitDiffRequest
.
new
(
request_params
)
response
=
diff_service_stub
.
commit_diff
(
Gitaly
::
CommitDiffRequest
.
new
(
request_params
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:diff
,
:commit_diff
,
request
)
Gitlab
::
Git
::
DiffCollection
.
new
(
GitalyClient
::
DiffStitcher
.
new
(
response
),
options
)
Gitlab
::
Git
::
DiffCollection
.
new
(
GitalyClient
::
DiffStitcher
.
new
(
response
),
options
)
end
end
def
commit_deltas
(
commit
)
def
commit_deltas
(
commit
)
request_params
=
commit_diff_request_params
(
commit
)
request
=
Gitaly
::
CommitDeltaRequest
.
new
(
commit_diff_request_params
(
commit
))
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:diff
,
:commit_delta
,
request
)
response
=
diff_service_stub
.
commit_delta
(
Gitaly
::
CommitDeltaRequest
.
new
(
request_params
))
response
.
flat_map
do
|
msg
|
response
.
flat_map
do
|
msg
|
msg
.
deltas
.
map
{
|
d
|
Gitlab
::
Git
::
Diff
.
new
(
d
)
}
msg
.
deltas
.
map
{
|
d
|
Gitlab
::
Git
::
Diff
.
new
(
d
)
}
end
end
...
@@ -50,10 +48,6 @@ module Gitlab
...
@@ -50,10 +48,6 @@ module Gitlab
paths:
options
.
fetch
(
:paths
,
[])
paths:
options
.
fetch
(
:paths
,
[])
}
}
end
end
def
diff_service_stub
GitalyClient
.
stub
(
:diff
,
@repository
.
storage
)
end
end
end
end
end
end
end
lib/gitlab/gitaly_client/notifications.rb
View file @
21465dee
module
Gitlab
module
Gitlab
module
GitalyClient
module
GitalyClient
class
Notifications
class
Notifications
attr_accessor
:stub
# 'repository' is a Gitlab::Git::Repository
# 'repository' is a Gitlab::Git::Repository
def
initialize
(
repository
)
def
initialize
(
repository
)
@gitaly_repo
=
repository
.
gitaly_repository
@gitaly_repo
=
repository
.
gitaly_repository
@st
ub
=
GitalyClient
.
stub
(
:notifications
,
repository
.
storage
)
@st
orage
=
repository
.
storage
end
end
def
post_receive
def
post_receive
request
=
Gitaly
::
PostReceiveRequest
.
new
(
repository:
@gitaly_repo
)
GitalyClient
.
call
(
@stub
.
post_receive
(
request
)
@storage
,
:notifications
,
:post_receive
,
Gitaly
::
PostReceiveRequest
.
new
(
repository:
@gitaly_repo
)
)
end
end
end
end
end
end
...
...
lib/gitlab/gitaly_client/ref.rb
View file @
21465dee
module
Gitlab
module
Gitlab
module
GitalyClient
module
GitalyClient
class
Ref
class
Ref
attr_accessor
:stub
# 'repository' is a Gitlab::Git::Repository
# 'repository' is a Gitlab::Git::Repository
def
initialize
(
repository
)
def
initialize
(
repository
)
@gitaly_repo
=
repository
.
gitaly_repository
@gitaly_repo
=
repository
.
gitaly_repository
@st
ub
=
GitalyClient
.
stub
(
:ref
,
repository
.
storage
)
@st
orage
=
repository
.
storage
end
end
def
default_branch_name
def
default_branch_name
request
=
Gitaly
::
FindDefaultBranchNameRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindDefaultBranchNameRequest
.
new
(
repository:
@gitaly_repo
)
branch_name
=
stub
.
find_default_branch_name
(
request
).
name
response
=
GitalyClient
.
call
(
@storage
,
:ref
,
:find_default_branch_name
,
request
)
Gitlab
::
Git
.
branch_name
(
response
.
name
)
Gitlab
::
Git
.
branch_name
(
branch_name
)
end
end
def
branch_names
def
branch_names
request
=
Gitaly
::
FindAllBranchNamesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindAllBranchNamesRequest
.
new
(
repository:
@gitaly_repo
)
consume_refs_response
(
stub
.
find_all_branch_names
(
request
),
prefix:
'refs/heads/'
)
response
=
GitalyClient
.
call
(
@storage
,
:ref
,
:find_all_branch_names
,
request
)
consume_refs_response
(
response
,
prefix:
'refs/heads/'
)
end
end
def
tag_names
def
tag_names
request
=
Gitaly
::
FindAllTagNamesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindAllTagNamesRequest
.
new
(
repository:
@gitaly_repo
)
consume_refs_response
(
stub
.
find_all_tag_names
(
request
),
prefix:
'refs/tags/'
)
response
=
GitalyClient
.
call
(
@storage
,
:ref
,
:find_all_tag_names
,
request
)
consume_refs_response
(
response
,
prefix:
'refs/tags/'
)
end
end
def
find_ref_name
(
commit_id
,
ref_prefix
)
def
find_ref_name
(
commit_id
,
ref_prefix
)
...
@@ -32,8 +31,7 @@ module Gitlab
...
@@ -32,8 +31,7 @@ module Gitlab
commit_id:
commit_id
,
commit_id:
commit_id
,
prefix:
ref_prefix
prefix:
ref_prefix
)
)
GitalyClient
.
call
(
@storage
,
:ref
,
:find_ref_name
,
request
).
name
stub
.
find_ref_name
(
request
).
name
end
end
def
count_tag_names
def
count_tag_names
...
@@ -47,7 +45,8 @@ module Gitlab
...
@@ -47,7 +45,8 @@ module Gitlab
def
local_branches
(
sort_by:
nil
)
def
local_branches
(
sort_by:
nil
)
request
=
Gitaly
::
FindLocalBranchesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindLocalBranchesRequest
.
new
(
repository:
@gitaly_repo
)
request
.
sort_by
=
sort_by_param
(
sort_by
)
if
sort_by
request
.
sort_by
=
sort_by_param
(
sort_by
)
if
sort_by
consume_branches_response
(
stub
.
find_local_branches
(
request
))
response
=
GitalyClient
.
call
(
@storage
,
:ref
,
:find_local_branches
,
request
)
consume_branches_response
(
response
)
end
end
private
private
...
...
lib/gitlab/workhorse.rb
View file @
21465dee
...
@@ -26,7 +26,10 @@ module Gitlab
...
@@ -26,7 +26,10 @@ module Gitlab
}
}
if
Gitlab
.
config
.
gitaly
.
enabled
if
Gitlab
.
config
.
gitaly
.
enabled
address
=
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
)
server
=
{
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
}
params
[
:Repository
]
=
repository
.
gitaly_repository
.
to_h
params
[
:Repository
]
=
repository
.
gitaly_repository
.
to_h
feature_enabled
=
case
action
.
to_s
feature_enabled
=
case
action
.
to_s
...
@@ -39,8 +42,10 @@ module Gitlab
...
@@ -39,8 +42,10 @@ module Gitlab
else
else
raise
"Unsupported action:
#{
action
}
"
raise
"Unsupported action:
#{
action
}
"
end
end
if
feature_enabled
params
[
:GitalyAddress
]
=
address
if
feature_enabled
params
[
:GitalyAddress
]
=
server
[
:address
]
# This field will be deprecated
params
[
:GitalyServer
]
=
server
end
end
end
params
params
...
...
lib/tasks/gitlab/gitaly.rake
View file @
21465dee
...
@@ -58,8 +58,9 @@ namespace :gitlab do
...
@@ -58,8 +58,9 @@ namespace :gitlab do
storages
<<
{
name:
key
,
path:
val
[
'path'
]
}
storages
<<
{
name:
key
,
path:
val
[
'path'
]
}
end
end
config
=
{
socket_path:
address
.
sub
(
%r{
\A
unix:}
,
''
),
storage:
storages
}
TOML
.
dump
(
socket_path:
address
.
sub
(
%r{
\A
unix:}
,
''
),
storage:
storages
)
config
[
:auth
]
=
{
token:
'secret'
}
if
Rails
.
env
.
test?
TOML
.
dump
(
config
)
end
end
def
create_gitaly_configuration
def
create_gitaly_configuration
...
...
spec/lib/gitlab/gitaly_client/commit_spec.rb
View file @
21465dee
...
@@ -16,7 +16,7 @@ describe Gitlab::GitalyClient::Commit do
...
@@ -16,7 +16,7 @@ describe Gitlab::GitalyClient::Commit do
right_commit_id:
commit
.
id
right_commit_id:
commit
.
id
)
)
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_diff
).
with
(
request
)
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_diff
).
with
(
request
,
kind_of
(
Hash
)
)
described_class
.
new
(
repository
).
diff_from_parent
(
commit
)
described_class
.
new
(
repository
).
diff_from_parent
(
commit
)
end
end
...
@@ -31,7 +31,7 @@ describe Gitlab::GitalyClient::Commit do
...
@@ -31,7 +31,7 @@ describe Gitlab::GitalyClient::Commit do
right_commit_id:
initial_commit
.
id
right_commit_id:
initial_commit
.
id
)
)
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_diff
).
with
(
request
)
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_diff
).
with
(
request
,
kind_of
(
Hash
)
)
described_class
.
new
(
repository
).
diff_from_parent
(
initial_commit
)
described_class
.
new
(
repository
).
diff_from_parent
(
initial_commit
)
end
end
...
@@ -61,7 +61,7 @@ describe Gitlab::GitalyClient::Commit do
...
@@ -61,7 +61,7 @@ describe Gitlab::GitalyClient::Commit do
right_commit_id:
commit
.
id
right_commit_id:
commit
.
id
)
)
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_delta
).
with
(
request
).
and_return
([])
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_delta
).
with
(
request
,
kind_of
(
Hash
)
).
and_return
([])
described_class
.
new
(
repository
).
commit_deltas
(
commit
)
described_class
.
new
(
repository
).
commit_deltas
(
commit
)
end
end
...
@@ -76,7 +76,7 @@ describe Gitlab::GitalyClient::Commit do
...
@@ -76,7 +76,7 @@ describe Gitlab::GitalyClient::Commit do
right_commit_id:
initial_commit
.
id
right_commit_id:
initial_commit
.
id
)
)
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_delta
).
with
(
request
).
and_return
([])
expect_any_instance_of
(
Gitaly
::
Diff
::
Stub
).
to
receive
(
:commit_delta
).
with
(
request
,
kind_of
(
Hash
)
).
and_return
([])
described_class
.
new
(
repository
).
commit_deltas
(
initial_commit
)
described_class
.
new
(
repository
).
commit_deltas
(
initial_commit
)
end
end
...
...
spec/lib/gitlab/gitaly_client/notifications_spec.rb
View file @
21465dee
...
@@ -9,7 +9,7 @@ describe Gitlab::GitalyClient::Notifications do
...
@@ -9,7 +9,7 @@ describe Gitlab::GitalyClient::Notifications do
it
'sends a post_receive message'
do
it
'sends a post_receive message'
do
expect_any_instance_of
(
Gitaly
::
Notifications
::
Stub
).
expect_any_instance_of
(
Gitaly
::
Notifications
::
Stub
).
to
receive
(
:post_receive
).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
))
to
receive
(
:post_receive
).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)
,
kind_of
(
Hash
)
)
subject
.
post_receive
subject
.
post_receive
end
end
...
...
spec/lib/gitlab/gitaly_client/ref_spec.rb
View file @
21465dee
...
@@ -21,7 +21,7 @@ describe Gitlab::GitalyClient::Ref do
...
@@ -21,7 +21,7 @@ describe Gitlab::GitalyClient::Ref do
it
'sends a find_all_branch_names message'
do
it
'sends a find_all_branch_names message'
do
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
to
receive
(
:find_all_branch_names
).
to
receive
(
:find_all_branch_names
).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)
,
kind_of
(
Hash
)
).
and_return
([])
and_return
([])
client
.
branch_names
client
.
branch_names
...
@@ -32,7 +32,7 @@ describe Gitlab::GitalyClient::Ref do
...
@@ -32,7 +32,7 @@ describe Gitlab::GitalyClient::Ref do
it
'sends a find_all_tag_names message'
do
it
'sends a find_all_tag_names message'
do
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
to
receive
(
:find_all_tag_names
).
to
receive
(
:find_all_tag_names
).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)
,
kind_of
(
Hash
)
).
and_return
([])
and_return
([])
client
.
tag_names
client
.
tag_names
...
@@ -43,7 +43,7 @@ describe Gitlab::GitalyClient::Ref do
...
@@ -43,7 +43,7 @@ describe Gitlab::GitalyClient::Ref do
it
'sends a find_default_branch_name message'
do
it
'sends a find_default_branch_name message'
do
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
to
receive
(
:find_default_branch_name
).
to
receive
(
:find_default_branch_name
).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)
,
kind_of
(
Hash
)
).
and_return
(
double
(
name:
'foo'
))
and_return
(
double
(
name:
'foo'
))
client
.
default_branch_name
client
.
default_branch_name
...
@@ -54,7 +54,7 @@ describe Gitlab::GitalyClient::Ref do
...
@@ -54,7 +54,7 @@ describe Gitlab::GitalyClient::Ref do
it
'sends a find_local_branches message'
do
it
'sends a find_local_branches message'
do
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
to
receive
(
:find_local_branches
).
to
receive
(
:find_local_branches
).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)).
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
)
,
kind_of
(
Hash
)
).
and_return
([])
and_return
([])
client
.
local_branches
client
.
local_branches
...
@@ -63,7 +63,7 @@ describe Gitlab::GitalyClient::Ref do
...
@@ -63,7 +63,7 @@ describe Gitlab::GitalyClient::Ref do
it
'parses and sends the sort parameter'
do
it
'parses and sends the sort parameter'
do
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
expect_any_instance_of
(
Gitaly
::
Ref
::
Stub
).
to
receive
(
:find_local_branches
).
to
receive
(
:find_local_branches
).
with
(
gitaly_request_with_params
(
sort_by: :UPDATED_DESC
)).
with
(
gitaly_request_with_params
(
sort_by: :UPDATED_DESC
)
,
kind_of
(
Hash
)
).
and_return
([])
and_return
([])
client
.
local_branches
(
sort_by:
'updated_desc'
)
client
.
local_branches
(
sort_by:
'updated_desc'
)
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
21465dee
...
@@ -202,7 +202,11 @@ describe Gitlab::Workhorse, lib: true do
...
@@ -202,7 +202,11 @@ describe Gitlab::Workhorse, lib: true do
context
'when Gitaly is enabled'
do
context
'when Gitaly is enabled'
do
let
(
:gitaly_params
)
do
let
(
:gitaly_params
)
do
{
{
GitalyAddress
:
Gitlab
::
GitalyClient
.
address
(
'default'
)
GitalyAddress
:
Gitlab
::
GitalyClient
.
address
(
'default'
),
GitalyServer
:
{
address:
Gitlab
::
GitalyClient
.
address
(
'default'
),
token:
Gitlab
::
GitalyClient
.
token
(
'default'
)
}
}
}
end
end
...
...
spec/tasks/gitlab/gitaly_rake_spec.rb
View file @
21465dee
...
@@ -89,6 +89,7 @@ describe 'gitlab:gitaly namespace rake task' do
...
@@ -89,6 +89,7 @@ describe 'gitlab:gitaly namespace rake task' do
}
}
}
}
allow
(
Gitlab
.
config
.
repositories
).
to
receive
(
:storages
).
and_return
(
config
)
allow
(
Gitlab
.
config
.
repositories
).
to
receive
(
:storages
).
and_return
(
config
)
allow
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
false
)
expected_output
=
''
expected_output
=
''
Timecop
.
freeze
do
Timecop
.
freeze
do
...
...
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