BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
13487809
Commit
13487809
authored
Mar 30, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass Gitaly Repository messages to workhorse
parent
88812ce2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
workhorse.rb
lib/gitlab/workhorse.rb
+10
-2
workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+7
-1
No files found.
lib/gitlab/workhorse.rb
View file @
13487809
...
...
@@ -17,14 +17,22 @@ module Gitlab
class
<<
self
def
git_http_ok
(
repository
,
user
)
repo_path
=
repository
.
path_to_repo
params
=
{
GL_ID
:
Gitlab
::
GlId
.
gl_id
(
user
),
RepoPath
:
repo
sitory
.
path_to_repo
,
RepoPath
:
repo
_path
,
}
if
Gitlab
.
config
.
gitaly
.
enabled
address
=
Gitlab
::
GitalyClient
.
get_address
(
repository
.
project
.
repository_storage
)
storage
=
repository
.
project
.
repository_storage
address
=
Gitlab
::
GitalyClient
.
get_address
(
storage
)
params
[
:GitalySocketPath
]
=
URI
(
address
).
path
# TODO: use GitalyClient code to assemble the Repository message
params
[
:Repository
]
=
Gitaly
::
Repository
.
new
(
path:
repo_path
,
storage_name:
storage
,
relative_path:
Gitlab
::
RepoPath
.
strip_storage_path
(
repo_path
),
).
to_h
end
params
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
13487809
...
...
@@ -179,10 +179,11 @@ describe Gitlab::Workhorse, lib: true do
describe
'.git_http_ok'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:repo_path
)
{
repository
.
path_to_repo
}
subject
{
described_class
.
git_http_ok
(
repository
,
user
)
}
it
{
expect
(
subject
).
to
eq
({
GL_ID
:
"user-
#{
user
.
id
}
"
,
RepoPath
:
repo
sitory
.
path_to_repo
})
}
it
{
expect
(
subject
).
to
eq
({
GL_ID
:
"user-
#{
user
.
id
}
"
,
RepoPath
:
repo
_path
})
}
context
'when Gitaly is enabled'
do
before
do
...
...
@@ -192,6 +193,11 @@ describe Gitlab::Workhorse, lib: true do
it
'includes Gitaly params in the returned value'
do
gitaly_socket_path
=
URI
(
Gitlab
::
GitalyClient
.
get_address
(
'default'
)).
path
expect
(
subject
).
to
include
({
GitalySocketPath
:
gitaly_socket_path
})
expect
(
subject
[
:Repository
]).
to
include
({
path:
repo_path
,
storage_name:
'default'
,
relative_path:
project
.
full_path
+
'.git'
,
})
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