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
583635f0
Commit
583635f0
authored
Jul 05, 2018
by
Andrew Newdigate
Committed by
Rémy Coutable
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Gitaly timeout values
parent
7eddfef4
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
49 deletions
+55
-49
changelogs/unreleased/gitaly-timeouts.yml
changelogs/unreleased/gitaly-timeouts.yml
+5
-0
lib/gitlab/gitaly_client/blob_service.rb
lib/gitlab/gitaly_client/blob_service.rb
+5
-5
lib/gitlab/gitaly_client/commit_service.rb
lib/gitlab/gitaly_client/commit_service.rb
+4
-4
lib/gitlab/gitaly_client/conflicts_service.rb
lib/gitlab/gitaly_client/conflicts_service.rb
+1
-1
lib/gitlab/gitaly_client/namespace_service.rb
lib/gitlab/gitaly_client/namespace_service.rb
+6
-6
lib/gitlab/gitaly_client/operation_service.rb
lib/gitlab/gitaly_client/operation_service.rb
+4
-3
lib/gitlab/gitaly_client/ref_service.rb
lib/gitlab/gitaly_client/ref_service.rb
+13
-13
lib/gitlab/gitaly_client/remote_service.rb
lib/gitlab/gitaly_client/remote_service.rb
+2
-2
lib/gitlab/gitaly_client/repository_service.rb
lib/gitlab/gitaly_client/repository_service.rb
+10
-10
lib/gitlab/gitaly_client/wiki_service.rb
lib/gitlab/gitaly_client/wiki_service.rb
+5
-5
No files found.
changelogs/unreleased/gitaly-timeouts.yml
0 → 100644
View file @
583635f0
---
title
:
Updated Gitaly fail-fast timeout values
merge_request
:
!20259
author
:
type
:
performance
lib/gitlab/gitaly_client/blob_service.rb
View file @
583635f0
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
oid:
oid
,
oid:
oid
,
limit:
limit
limit:
limit
)
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_blob
,
request
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_blob
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
data
=
''
data
=
''
blob
=
nil
blob
=
nil
...
@@ -43,7 +43,7 @@ module Gitlab
...
@@ -43,7 +43,7 @@ module Gitlab
blob_ids:
blob_ids
blob_ids:
blob_ids
)
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_lfs_pointers
,
request
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_lfs_pointers
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
map_lfs_pointers
(
response
)
map_lfs_pointers
(
response
)
end
end
...
@@ -66,7 +66,7 @@ module Gitlab
...
@@ -66,7 +66,7 @@ module Gitlab
:blob_service
,
:blob_service
,
:get_blobs
,
:get_blobs
,
request
,
request
,
timeout:
GitalyClient
.
defaul
t_timeout
timeout:
GitalyClient
.
fas
t_timeout
)
)
GitalyClient
::
BlobsStitcher
.
new
(
response
)
GitalyClient
::
BlobsStitcher
.
new
(
response
)
...
@@ -85,7 +85,7 @@ module Gitlab
...
@@ -85,7 +85,7 @@ module Gitlab
request
.
not_in_refs
+=
not_in
request
.
not_in_refs
+=
not_in
end
end
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_new_lfs_pointers
,
request
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_new_lfs_pointers
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
map_lfs_pointers
(
response
)
map_lfs_pointers
(
response
)
end
end
...
@@ -96,7 +96,7 @@ module Gitlab
...
@@ -96,7 +96,7 @@ module Gitlab
revision:
encode_binary
(
revision
)
revision:
encode_binary
(
revision
)
)
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_all_lfs_pointers
,
request
)
response
=
GitalyClient
.
call
(
@gitaly_repo
.
storage_name
,
:blob_service
,
:get_all_lfs_pointers
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
map_lfs_pointers
(
response
)
map_lfs_pointers
(
response
)
end
end
...
...
lib/gitlab/gitaly_client/commit_service.rb
View file @
583635f0
...
@@ -70,7 +70,7 @@ module Gitlab
...
@@ -70,7 +70,7 @@ module Gitlab
def
commit_deltas
(
commit
)
def
commit_deltas
(
commit
)
request
=
Gitaly
::
CommitDeltaRequest
.
new
(
diff_from_parent_request_params
(
commit
))
request
=
Gitaly
::
CommitDeltaRequest
.
new
(
diff_from_parent_request_params
(
commit
))
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:diff_service
,
:commit_delta
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:diff_service
,
:commit_delta
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
flat_map
{
|
msg
|
msg
.
deltas
}
response
.
flat_map
{
|
msg
|
msg
.
deltas
}
end
end
...
@@ -302,7 +302,7 @@ module Gitlab
...
@@ -302,7 +302,7 @@ module Gitlab
end
end
end
end
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:filter_shas_with_signatures
,
enum
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:filter_shas_with_signatures
,
enum
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
flat_map
do
|
msg
|
response
.
flat_map
do
|
msg
|
msg
.
shas
.
map
{
|
sha
|
EncodingHelper
.
encode!
(
sha
)
}
msg
.
shas
.
map
{
|
sha
|
EncodingHelper
.
encode!
(
sha
)
}
...
@@ -330,7 +330,7 @@ module Gitlab
...
@@ -330,7 +330,7 @@ module Gitlab
def
get_commit_signatures
(
commit_ids
)
def
get_commit_signatures
(
commit_ids
)
request
=
Gitaly
::
GetCommitSignaturesRequest
.
new
(
repository:
@gitaly_repo
,
commit_ids:
commit_ids
)
request
=
Gitaly
::
GetCommitSignaturesRequest
.
new
(
repository:
@gitaly_repo
,
commit_ids:
commit_ids
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:get_commit_signatures
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:get_commit_signatures
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
signatures
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
[
''
.
b
,
''
.
b
]
}
signatures
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
[
''
.
b
,
''
.
b
]
}
current_commit_id
=
nil
current_commit_id
=
nil
...
@@ -349,7 +349,7 @@ module Gitlab
...
@@ -349,7 +349,7 @@ module Gitlab
def
get_commit_messages
(
commit_ids
)
def
get_commit_messages
(
commit_ids
)
request
=
Gitaly
::
GetCommitMessagesRequest
.
new
(
repository:
@gitaly_repo
,
commit_ids:
commit_ids
)
request
=
Gitaly
::
GetCommitMessagesRequest
.
new
(
repository:
@gitaly_repo
,
commit_ids:
commit_ids
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:get_commit_messages
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:get_commit_messages
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
messages
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
''
.
b
}
messages
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
''
.
b
}
current_commit_id
=
nil
current_commit_id
=
nil
...
...
lib/gitlab/gitaly_client/conflicts_service.rb
View file @
583635f0
...
@@ -46,7 +46,7 @@ module Gitlab
...
@@ -46,7 +46,7 @@ module Gitlab
end
end
end
end
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:conflicts_service
,
:resolve_conflicts
,
req_enum
,
remote_storage:
target_repository
.
storage
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:conflicts_service
,
:resolve_conflicts
,
req_enum
,
remote_storage:
target_repository
.
storage
,
timeout:
GitalyClient
.
medium_timeout
)
if
response
.
resolution_error
.
present?
if
response
.
resolution_error
.
present?
raise
Gitlab
::
Git
::
Conflict
::
Resolver
::
ResolutionError
,
response
.
resolution_error
raise
Gitlab
::
Git
::
Conflict
::
Resolver
::
ResolutionError
,
response
.
resolution_error
...
...
lib/gitlab/gitaly_client/namespace_service.rb
View file @
583635f0
...
@@ -8,31 +8,31 @@ module Gitlab
...
@@ -8,31 +8,31 @@ module Gitlab
def
exists?
(
name
)
def
exists?
(
name
)
request
=
Gitaly
::
NamespaceExistsRequest
.
new
(
storage_name:
@storage
,
name:
name
)
request
=
Gitaly
::
NamespaceExistsRequest
.
new
(
storage_name:
@storage
,
name:
name
)
gitaly_client_call
(
:namespace_exists
,
request
).
exists
gitaly_client_call
(
:namespace_exists
,
request
,
timeout:
GitalyClient
.
fast_timeout
).
exists
end
end
def
add
(
name
)
def
add
(
name
)
request
=
Gitaly
::
AddNamespaceRequest
.
new
(
storage_name:
@storage
,
name:
name
)
request
=
Gitaly
::
AddNamespaceRequest
.
new
(
storage_name:
@storage
,
name:
name
)
gitaly_client_call
(
:add_namespace
,
request
)
gitaly_client_call
(
:add_namespace
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
end
end
def
remove
(
name
)
def
remove
(
name
)
request
=
Gitaly
::
RemoveNamespaceRequest
.
new
(
storage_name:
@storage
,
name:
name
)
request
=
Gitaly
::
RemoveNamespaceRequest
.
new
(
storage_name:
@storage
,
name:
name
)
gitaly_client_call
(
:remove_namespace
,
request
)
gitaly_client_call
(
:remove_namespace
,
request
,
timeout:
nil
)
end
end
def
rename
(
from
,
to
)
def
rename
(
from
,
to
)
request
=
Gitaly
::
RenameNamespaceRequest
.
new
(
storage_name:
@storage
,
from:
from
,
to:
to
)
request
=
Gitaly
::
RenameNamespaceRequest
.
new
(
storage_name:
@storage
,
from:
from
,
to:
to
)
gitaly_client_call
(
:rename_namespace
,
request
)
gitaly_client_call
(
:rename_namespace
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
end
end
private
private
def
gitaly_client_call
(
type
,
request
)
def
gitaly_client_call
(
type
,
request
,
timeout:
nil
)
GitalyClient
.
call
(
@storage
,
:namespace_service
,
type
,
request
)
GitalyClient
.
call
(
@storage
,
:namespace_service
,
type
,
request
,
timeout:
timeout
)
end
end
end
end
end
end
...
...
lib/gitlab/gitaly_client/operation_service.rb
View file @
583635f0
...
@@ -17,7 +17,7 @@ module Gitlab
...
@@ -17,7 +17,7 @@ module Gitlab
user:
Gitlab
::
Git
::
User
.
from_gitlab
(
user
).
to_gitaly
user:
Gitlab
::
Git
::
User
.
from_gitlab
(
user
).
to_gitaly
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:operation_service
,
:user_delete_tag
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:operation_service
,
:user_delete_tag
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
if
pre_receive_error
=
response
.
pre_receive_error
.
presence
if
pre_receive_error
=
response
.
pre_receive_error
.
presence
raise
Gitlab
::
Git
::
PreReceiveError
,
pre_receive_error
raise
Gitlab
::
Git
::
PreReceiveError
,
pre_receive_error
...
@@ -33,7 +33,7 @@ module Gitlab
...
@@ -33,7 +33,7 @@ module Gitlab
message:
encode_binary
(
message
.
to_s
)
message:
encode_binary
(
message
.
to_s
)
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:operation_service
,
:user_create_tag
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:operation_service
,
:user_create_tag
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
if
pre_receive_error
=
response
.
pre_receive_error
.
presence
if
pre_receive_error
=
response
.
pre_receive_error
.
presence
raise
Gitlab
::
Git
::
PreReceiveError
,
pre_receive_error
raise
Gitlab
::
Git
::
PreReceiveError
,
pre_receive_error
elsif
response
.
exists
elsif
response
.
exists
...
@@ -276,7 +276,8 @@ module Gitlab
...
@@ -276,7 +276,8 @@ module Gitlab
:operation_service
,
:operation_service
,
:"user_
#{
rpc
}
"
,
:"user_
#{
rpc
}
"
,
request
,
request
,
remote_storage:
start_repository
.
storage
remote_storage:
start_repository
.
storage
,
timeout:
GitalyClient
.
medium_timeout
)
)
handle_cherry_pick_or_revert_response
(
response
)
handle_cherry_pick_or_revert_response
(
response
)
...
...
lib/gitlab/gitaly_client/ref_service.rb
View file @
583635f0
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
def
branches
def
branches
request
=
Gitaly
::
FindAllBranchesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindAllBranchesRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_branches
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_branches
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
consume_find_all_branches_response
(
response
)
consume_find_all_branches_response
(
response
)
end
end
...
@@ -23,26 +23,26 @@ module Gitlab
...
@@ -23,26 +23,26 @@ module Gitlab
merged_only:
true
,
merged_only:
true
,
merged_branches:
branch_names
.
map
{
|
s
|
encode_binary
(
s
)
}
merged_branches:
branch_names
.
map
{
|
s
|
encode_binary
(
s
)
}
)
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_branches
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_branches
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
consume_find_all_branches_response
(
response
)
consume_find_all_branches_response
(
response
)
end
end
def
default_branch_name
def
default_branch_name
request
=
Gitaly
::
FindDefaultBranchNameRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindDefaultBranchNameRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_default_branch_name
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_default_branch_name
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
Gitlab
::
Git
.
branch_name
(
response
.
name
)
Gitlab
::
Git
.
branch_name
(
response
.
name
)
end
end
def
branch_names
def
branch_names
request
=
Gitaly
::
FindAllBranchNamesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindAllBranchNamesRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_branch_names
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_branch_names
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
consume_refs_response
(
response
)
{
|
name
|
Gitlab
::
Git
.
branch_name
(
name
)
}
consume_refs_response
(
response
)
{
|
name
|
Gitlab
::
Git
.
branch_name
(
name
)
}
end
end
def
tag_names
def
tag_names
request
=
Gitaly
::
FindAllTagNamesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindAllTagNamesRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_tag_names
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_tag_names
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
consume_refs_response
(
response
)
{
|
name
|
Gitlab
::
Git
.
tag_name
(
name
)
}
consume_refs_response
(
response
)
{
|
name
|
Gitlab
::
Git
.
tag_name
(
name
)
}
end
end
...
@@ -67,19 +67,19 @@ module Gitlab
...
@@ -67,19 +67,19 @@ 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
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_local_branches
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_local_branches
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
consume_find_local_branches_response
(
response
)
consume_find_local_branches_response
(
response
)
end
end
def
tags
def
tags
request
=
Gitaly
::
FindAllTagsRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
FindAllTagsRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_tags
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:find_all_tags
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
consume_tags_response
(
response
)
consume_tags_response
(
response
)
end
end
def
ref_exists?
(
ref_name
)
def
ref_exists?
(
ref_name
)
request
=
Gitaly
::
RefExistsRequest
.
new
(
repository:
@gitaly_repo
,
ref:
encode_binary
(
ref_name
))
request
=
Gitaly
::
RefExistsRequest
.
new
(
repository:
@gitaly_repo
,
ref:
encode_binary
(
ref_name
))
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:ref_exists
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:ref_service
,
:ref_exists
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
value
response
.
value
rescue
GRPC
::
InvalidArgument
=>
e
rescue
GRPC
::
InvalidArgument
=>
e
raise
ArgumentError
,
e
.
message
raise
ArgumentError
,
e
.
message
...
@@ -91,7 +91,7 @@ module Gitlab
...
@@ -91,7 +91,7 @@ module Gitlab
name:
encode_binary
(
branch_name
)
name:
encode_binary
(
branch_name
)
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:find_branch
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:find_branch
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
branch
=
response
.
branch
branch
=
response
.
branch
return
unless
branch
return
unless
branch
...
@@ -140,7 +140,7 @@ module Gitlab
...
@@ -140,7 +140,7 @@ module Gitlab
except_with_prefix:
except_with_prefixes
.
map
{
|
r
|
encode_binary
(
r
)
}
except_with_prefix:
except_with_prefixes
.
map
{
|
r
|
encode_binary
(
r
)
}
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:delete_refs
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:delete_refs
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
raise
Gitlab
::
Git
::
Repository
::
GitError
,
response
.
git_error
if
response
.
git_error
.
present?
raise
Gitlab
::
Git
::
Repository
::
GitError
,
response
.
git_error
if
response
.
git_error
.
present?
end
end
...
@@ -153,7 +153,7 @@ module Gitlab
...
@@ -153,7 +153,7 @@ module Gitlab
limit:
limit
limit:
limit
)
)
stream
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:list_tag_names_containing_commit
,
request
)
stream
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:list_tag_names_containing_commit
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
consume_ref_contains_sha_response
(
stream
,
:tag_names
)
consume_ref_contains_sha_response
(
stream
,
:tag_names
)
end
end
...
@@ -166,14 +166,14 @@ module Gitlab
...
@@ -166,14 +166,14 @@ module Gitlab
limit:
limit
limit:
limit
)
)
stream
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:list_branch_names_containing_commit
,
request
)
stream
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:list_branch_names_containing_commit
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
consume_ref_contains_sha_response
(
stream
,
:branch_names
)
consume_ref_contains_sha_response
(
stream
,
:branch_names
)
end
end
def
get_tag_messages
(
tag_ids
)
def
get_tag_messages
(
tag_ids
)
request
=
Gitaly
::
GetTagMessagesRequest
.
new
(
repository:
@gitaly_repo
,
tag_ids:
tag_ids
)
request
=
Gitaly
::
GetTagMessagesRequest
.
new
(
repository:
@gitaly_repo
,
tag_ids:
tag_ids
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:get_tag_messages
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:ref_service
,
:get_tag_messages
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
messages
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
''
.
b
}
messages
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
''
.
b
}
current_tag_id
=
nil
current_tag_id
=
nil
...
...
lib/gitlab/gitaly_client/remote_service.rb
View file @
583635f0
...
@@ -28,13 +28,13 @@ module Gitlab
...
@@ -28,13 +28,13 @@ module Gitlab
mirror_refmaps:
Array
.
wrap
(
mirror_refmaps
).
map
(
&
:to_s
)
mirror_refmaps:
Array
.
wrap
(
mirror_refmaps
).
map
(
&
:to_s
)
)
)
GitalyClient
.
call
(
@storage
,
:remote_service
,
:add_remote
,
request
)
GitalyClient
.
call
(
@storage
,
:remote_service
,
:add_remote
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
end
end
def
remove_remote
(
name
)
def
remove_remote
(
name
)
request
=
Gitaly
::
RemoveRemoteRequest
.
new
(
repository:
@gitaly_repo
,
name:
name
)
request
=
Gitaly
::
RemoveRemoteRequest
.
new
(
repository:
@gitaly_repo
,
name:
name
)
response
=
GitalyClient
.
call
(
@storage
,
:remote_service
,
:remove_remote
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:remote_service
,
:remove_remote
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
result
response
.
result
end
end
...
...
lib/gitlab/gitaly_client/repository_service.rb
View file @
583635f0
...
@@ -21,7 +21,7 @@ module Gitlab
...
@@ -21,7 +21,7 @@ module Gitlab
def
cleanup
def
cleanup
request
=
Gitaly
::
CleanupRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
CleanupRequest
.
new
(
repository:
@gitaly_repo
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:cleanup
,
request
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:cleanup
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
end
end
def
garbage_collect
(
create_bitmap
)
def
garbage_collect
(
create_bitmap
)
...
@@ -41,13 +41,13 @@ module Gitlab
...
@@ -41,13 +41,13 @@ module Gitlab
def
repository_size
def
repository_size
request
=
Gitaly
::
RepositorySizeRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
RepositorySizeRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:repository_size
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:repository_size
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
response
.
size
response
.
size
end
end
def
apply_gitattributes
(
revision
)
def
apply_gitattributes
(
revision
)
request
=
Gitaly
::
ApplyGitattributesRequest
.
new
(
repository:
@gitaly_repo
,
revision:
encode_binary
(
revision
))
request
=
Gitaly
::
ApplyGitattributesRequest
.
new
(
repository:
@gitaly_repo
,
revision:
encode_binary
(
revision
))
GitalyClient
.
call
(
@storage
,
:repository_service
,
:apply_gitattributes
,
request
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:apply_gitattributes
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
rescue
GRPC
::
InvalidArgument
=>
ex
rescue
GRPC
::
InvalidArgument
=>
ex
raise
Gitlab
::
Git
::
Repository
::
InvalidRef
,
ex
raise
Gitlab
::
Git
::
Repository
::
InvalidRef
,
ex
end
end
...
@@ -55,7 +55,7 @@ module Gitlab
...
@@ -55,7 +55,7 @@ module Gitlab
def
info_attributes
def
info_attributes
request
=
Gitaly
::
GetInfoAttributesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
GetInfoAttributesRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:get_info_attributes
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:get_info_attributes
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
each_with_object
(
""
)
do
|
message
,
attributes
|
response
.
each_with_object
(
""
)
do
|
message
,
attributes
|
attributes
<<
message
.
attributes
attributes
<<
message
.
attributes
end
end
...
@@ -82,7 +82,7 @@ module Gitlab
...
@@ -82,7 +82,7 @@ module Gitlab
def
create_repository
def
create_repository
request
=
Gitaly
::
CreateRepositoryRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
CreateRepositoryRequest
.
new
(
repository:
@gitaly_repo
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:create_repository
,
request
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:create_repository
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
end
end
def
has_local_branches?
def
has_local_branches?
...
@@ -98,7 +98,7 @@ module Gitlab
...
@@ -98,7 +98,7 @@ module Gitlab
revisions:
revisions
.
map
{
|
r
|
encode_binary
(
r
)
}
revisions:
revisions
.
map
{
|
r
|
encode_binary
(
r
)
}
)
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:find_merge_base
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:find_merge_base
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
base
.
presence
response
.
base
.
presence
end
end
...
@@ -258,7 +258,7 @@ module Gitlab
...
@@ -258,7 +258,7 @@ module Gitlab
)
)
request
.
old_revision
=
old_ref
.
b
unless
old_ref
.
nil?
request
.
old_revision
=
old_ref
.
b
unless
old_ref
.
nil?
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:write_ref
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:write_ref
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
raise
Gitlab
::
Git
::
CommandError
,
encode!
(
response
.
error
)
if
response
.
error
.
present?
raise
Gitlab
::
Git
::
CommandError
,
encode!
(
response
.
error
)
if
response
.
error
.
present?
...
@@ -288,7 +288,7 @@ module Gitlab
...
@@ -288,7 +288,7 @@ module Gitlab
def
calculate_checksum
def
calculate_checksum
request
=
Gitaly
::
CalculateChecksumRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
CalculateChecksumRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:calculate_checksum
,
request
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:calculate_checksum
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
response
.
checksum
.
presence
response
.
checksum
.
presence
rescue
GRPC
::
DataLoss
=>
e
rescue
GRPC
::
DataLoss
=>
e
raise
Gitlab
::
Git
::
Repository
::
InvalidRepository
.
new
(
e
)
raise
Gitlab
::
Git
::
Repository
::
InvalidRepository
.
new
(
e
)
...
@@ -297,12 +297,12 @@ module Gitlab
...
@@ -297,12 +297,12 @@ module Gitlab
def
raw_changes_between
(
from
,
to
)
def
raw_changes_between
(
from
,
to
)
request
=
Gitaly
::
GetRawChangesRequest
.
new
(
repository:
@gitaly_repo
,
from_revision:
from
,
to_revision:
to
)
request
=
Gitaly
::
GetRawChangesRequest
.
new
(
repository:
@gitaly_repo
,
from_revision:
from
,
to_revision:
to
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:get_raw_changes
,
request
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:get_raw_changes
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
end
end
def
search_files_by_name
(
ref
,
query
)
def
search_files_by_name
(
ref
,
query
)
request
=
Gitaly
::
SearchFilesByNameRequest
.
new
(
repository:
@gitaly_repo
,
ref:
ref
,
query:
query
)
request
=
Gitaly
::
SearchFilesByNameRequest
.
new
(
repository:
@gitaly_repo
,
ref:
ref
,
query:
query
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:search_files_by_name
,
request
).
flat_map
(
&
:files
)
GitalyClient
.
call
(
@storage
,
:repository_service
,
:search_files_by_name
,
request
,
timeout:
GitalyClient
.
fast_timeout
).
flat_map
(
&
:files
)
end
end
def
search_files_by_content
(
ref
,
query
)
def
search_files_by_content
(
ref
,
query
)
...
...
lib/gitlab/gitaly_client/wiki_service.rb
View file @
583635f0
...
@@ -69,7 +69,7 @@ module Gitlab
...
@@ -69,7 +69,7 @@ module Gitlab
commit_details:
gitaly_commit_details
(
commit_details
)
commit_details:
gitaly_commit_details
(
commit_details
)
)
)
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_delete_page
,
request
)
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_delete_page
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
end
end
def
find_page
(
title
:,
version:
nil
,
dir:
nil
)
def
find_page
(
title
:,
version:
nil
,
dir:
nil
)
...
@@ -80,14 +80,14 @@ module Gitlab
...
@@ -80,14 +80,14 @@ module Gitlab
directory:
encode_binary
(
dir
)
directory:
encode_binary
(
dir
)
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_find_page
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_find_page
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
wiki_page_from_iterator
(
response
)
wiki_page_from_iterator
(
response
)
end
end
def
get_all_pages
def
get_all_pages
request
=
Gitaly
::
WikiGetAllPagesRequest
.
new
(
repository:
@gitaly_repo
)
request
=
Gitaly
::
WikiGetAllPagesRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_get_all_pages
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_get_all_pages
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
pages
=
[]
pages
=
[]
loop
do
loop
do
...
@@ -113,7 +113,7 @@ module Gitlab
...
@@ -113,7 +113,7 @@ module Gitlab
per_page:
options
[
:per_page
]
||
Gollum
::
Page
.
per_page
per_page:
options
[
:per_page
]
||
Gollum
::
Page
.
per_page
)
)
stream
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_get_page_versions
,
request
)
stream
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_get_page_versions
,
request
,
timeout:
GitalyClient
.
medium_timeout
)
versions
=
[]
versions
=
[]
stream
.
each
do
|
message
|
stream
.
each
do
|
message
|
...
@@ -132,7 +132,7 @@ module Gitlab
...
@@ -132,7 +132,7 @@ module Gitlab
revision:
encode_binary
(
revision
)
revision:
encode_binary
(
revision
)
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_find_file
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:wiki_service
,
:wiki_find_file
,
request
,
timeout:
GitalyClient
.
fast_timeout
)
wiki_file
=
nil
wiki_file
=
nil
response
.
each
do
|
message
|
response
.
each
do
|
message
|
...
...
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