Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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-workhorse
Commits
ed934d46
Commit
ed934d46
authored
Apr 05, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using GitalySocketPath
parent
d8b8e6f4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
44 deletions
+23
-44
internal/api/api.go
internal/api/api.go
+0
-8
main_test.go
main_test.go
+23
-36
No files found.
internal/api/api.go
View file @
ed934d46
...
@@ -89,8 +89,6 @@ type Response struct {
...
@@ -89,8 +89,6 @@ type Response struct {
Entry
string
`json:"entry"`
Entry
string
`json:"entry"`
// Used to communicate terminal session details
// Used to communicate terminal session details
Terminal
*
TerminalSettings
Terminal
*
TerminalSettings
// Path to Gitaly Socket (deprecated in favor of GitalyAddress)
GitalySocketPath
string
// GitalyAddress is a unix:// or tcp:// address to reach a Gitaly service on
// GitalyAddress is a unix:// or tcp:// address to reach a Gitaly service on
GitalyAddress
string
GitalyAddress
string
// Repository object for making gRPC requests to Gitaly. This will
// Repository object for making gRPC requests to Gitaly. This will
...
@@ -222,12 +220,6 @@ func (api *API) PreAuthorize(suffix string, r *http.Request) (httpResponse *http
...
@@ -222,12 +220,6 @@ func (api *API) PreAuthorize(suffix string, r *http.Request) (httpResponse *http
authResponse
.
Repository
.
Path
=
authResponse
.
RepoPath
authResponse
.
Repository
.
Path
=
authResponse
.
RepoPath
}
}
if
socketPath
:=
authResponse
.
GitalySocketPath
;
socketPath
!=
""
&&
authResponse
.
GitalyAddress
==
""
{
// We are transitioning away from the GitalySocketPath response field.
// Until all the new code is in place, keep backwards compatibility.
authResponse
.
GitalyAddress
=
"unix://"
+
socketPath
}
return
httpResponse
,
authResponse
,
nil
return
httpResponse
,
authResponse
,
nil
}
}
...
...
main_test.go
View file @
ed934d46
...
@@ -145,7 +145,7 @@ func TestFailedCloneNoGitaly(t *testing.T) {
...
@@ -145,7 +145,7 @@ func TestFailedCloneNoGitaly(t *testing.T) {
GL_ID
:
"user-123"
,
GL_ID
:
"user-123"
,
RepoPath
:
repoPath
(
t
),
RepoPath
:
repoPath
(
t
),
// This will create a failure to connect to Gitaly
// This will create a failure to connect to Gitaly
Gitaly
SocketPath
:
"
/nonexistent"
,
Gitaly
Address
:
"unix:
/nonexistent"
,
}
}
// Prepare test server and backend
// Prepare test server and backend
...
@@ -603,19 +603,7 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) {
...
@@ -603,19 +603,7 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) {
defer
gitalyServer
.
Stop
()
defer
gitalyServer
.
Stop
()
gitalyAddress
:=
"unix://"
+
socketPath
gitalyAddress
:=
"unix://"
+
socketPath
apiResponse
.
GitalyAddress
=
gitalyAddress
addressCases
:=
[]
struct
{
socketPath
string
address
string
}{
{
socketPath
:
"/nonexistent,/should/be/ignored"
,
address
:
gitalyAddress
},
{
socketPath
:
socketPath
},
}
for
_
,
ac
:=
range
addressCases
{
func
()
{
apiResponse
.
GitalySocketPath
=
ac
.
socketPath
apiResponse
.
GitalyAddress
=
ac
.
address
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
defer
ts
.
Close
()
defer
ts
.
Close
()
...
@@ -638,8 +626,7 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) {
...
@@ -638,8 +626,7 @@ func TestGetInfoRefsProxiedToGitalySuccessfully(t *testing.T) {
if
!
bytes
.
Equal
(
responseBody
,
[]
byte
(
expectedContent
))
{
if
!
bytes
.
Equal
(
responseBody
,
[]
byte
(
expectedContent
))
{
t
.
Errorf
(
"GET %q: Expected %q, got %q"
,
resource
,
expectedContent
,
responseBody
)
t
.
Errorf
(
"GET %q: Expected %q, got %q"
,
resource
,
expectedContent
,
responseBody
)
}
}
}()
}
}
}
func
TestPostReceivePackProxiedToGitalySuccessfully
(
t
*
testing
.
T
)
{
func
TestPostReceivePackProxiedToGitalySuccessfully
(
t
*
testing
.
T
)
{
...
@@ -733,7 +720,7 @@ func TestGetInfoRefsHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
...
@@ -733,7 +720,7 @@ func TestGetInfoRefsHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
defer
gitalyServer
.
Stop
()
defer
gitalyServer
.
Stop
()
apiResponse
:=
gitOkBody
(
t
)
apiResponse
:=
gitOkBody
(
t
)
apiResponse
.
Gitaly
SocketPath
=
""
apiResponse
.
Gitaly
Address
=
""
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
defer
ts
.
Close
()
defer
ts
.
Close
()
...
@@ -766,7 +753,7 @@ func TestPostReceivePackHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
...
@@ -766,7 +753,7 @@ func TestPostReceivePackHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
defer
gitalyServer
.
Stop
()
defer
gitalyServer
.
Stop
()
apiResponse
:=
gitOkBody
(
t
)
apiResponse
:=
gitOkBody
(
t
)
apiResponse
.
Gitaly
SocketPath
=
""
apiResponse
.
Gitaly
Address
=
""
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
defer
ts
.
Close
()
defer
ts
.
Close
()
...
@@ -797,7 +784,7 @@ func TestPostUploadPackHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
...
@@ -797,7 +784,7 @@ func TestPostUploadPackHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
defer
gitalyServer
.
Stop
()
defer
gitalyServer
.
Stop
()
apiResponse
:=
gitOkBody
(
t
)
apiResponse
:=
gitOkBody
(
t
)
apiResponse
.
Gitaly
SocketPath
=
""
apiResponse
.
Gitaly
Address
=
""
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
defer
ts
.
Close
()
defer
ts
.
Close
()
...
...
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