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
dc94ea82
Commit
dc94ea82
authored
Apr 09, 2018
by
Simon
Committed by
Jacob Vosmaer (GitLab)
Apr 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes golint warnings
parent
4f15bdfa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
gitaly_test.go
gitaly_test.go
+2
-2
logging.go
logging.go
+1
-1
main.go
main.go
+1
-1
main_test.go
main_test.go
+5
-5
upload_test.go
upload_test.go
+6
-6
No files found.
gitaly_test.go
View file @
dc94ea82
...
...
@@ -633,7 +633,7 @@ func TestGetSnapshotProxiedToGitalyInterruptedStream(t *testing.T) {
func
buildGetSnapshotParams
(
gitalyAddress
string
,
repo
*
pb
.
Repository
)
string
{
msg
:=
serializedMessage
(
"GetSnapshotRequest"
,
&
pb
.
GetSnapshotRequest
{
Repository
:
repo
})
return
buildGitalyR
pc
Params
(
gitalyAddress
,
msg
)
return
buildGitalyR
PC
Params
(
gitalyAddress
,
msg
)
}
type
rpcArg
struct
{
...
...
@@ -645,7 +645,7 @@ type rpcArg struct {
// the RPC arguments (which are protobuf messages) in HTTP response headers.
// The messages are encoded to JSON objects using pbjson, The strings are then
// re-encoded to JSON strings using json. We must replicate this behaviour here
func
buildGitalyR
pc
Params
(
gitalyAddress
string
,
rpcArgs
...
rpcArg
)
string
{
func
buildGitalyR
PC
Params
(
gitalyAddress
string
,
rpcArgs
...
rpcArg
)
string
{
built
:=
map
[
string
]
interface
{}{
"GitalyServer"
:
map
[
string
]
string
{
"Address"
:
gitalyAddress
,
...
...
logging.go
View file @
dc94ea82
...
...
@@ -14,7 +14,7 @@ import (
)
func
reopenLogWriter
(
l
reopen
.
WriteCloser
,
sighup
chan
os
.
Signal
)
{
for
_
=
range
sighup
{
for
range
sighup
{
log
.
Print
(
"Reopening log file"
)
l
.
Reopen
()
}
...
...
main.go
View file @
dc94ea82
...
...
@@ -34,7 +34,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
)
//
C
urrent version of GitLab Workhorse
//
Version is the c
urrent version of GitLab Workhorse
var
Version
=
"(unknown version)"
// Set at build time in the Makefile
var
printVersion
=
flag
.
Bool
(
"version"
,
false
,
"Print version and exit"
)
...
...
main_test.go
View file @
dc94ea82
...
...
@@ -460,9 +460,9 @@ func TestSendURLForArtifacts(t *testing.T) {
}
func
TestGetGitBlob
(
t
*
testing
.
T
)
{
blobI
d
:=
"50b27c6518be44c42c4d87966ae2481ce895624c"
// the LICENSE file in the test repository
blobI
D
:=
"50b27c6518be44c42c4d87966ae2481ce895624c"
// the LICENSE file in the test repository
blobLength
:=
1075
jsonParams
:=
fmt
.
Sprintf
(
`{"RepoPath":"%s","BlobId":"%s"}`
,
path
.
Join
(
testRepoRoot
,
testRepo
),
blobI
d
)
jsonParams
:=
fmt
.
Sprintf
(
`{"RepoPath":"%s","BlobId":"%s"}`
,
path
.
Join
(
testRepoRoot
,
testRepo
),
blobI
D
)
expectedBody
:=
"The MIT License (MIT)"
resp
,
body
,
err
:=
doSendDataRequest
(
"/something"
,
"git-blob"
,
jsonParams
)
...
...
@@ -582,8 +582,8 @@ func setupStaticFile(fpath, content string) error {
if
err
:=
os
.
MkdirAll
(
path
.
Join
(
*
documentRoot
,
path
.
Dir
(
fpath
)),
0755
);
err
!=
nil
{
return
err
}
static
_f
ile
:=
path
.
Join
(
*
documentRoot
,
fpath
)
if
err
:=
ioutil
.
WriteFile
(
static
_f
ile
,
[]
byte
(
content
),
0666
);
err
!=
nil
{
static
F
ile
:=
path
.
Join
(
*
documentRoot
,
fpath
)
if
err
:=
ioutil
.
WriteFile
(
static
F
ile
,
[]
byte
(
content
),
0666
);
err
!=
nil
{
return
err
}
return
nil
...
...
@@ -638,7 +638,7 @@ func archiveOKServer(t *testing.T, archiveName string) *httptest.Server {
archivePath
:=
path
.
Join
(
cwd
,
cacheDir
,
archiveName
)
params
:=
struct
{
RepoPath
,
ArchivePath
,
CommitI
d
,
ArchivePrefix
string
}{
params
:=
struct
{
RepoPath
,
ArchivePath
,
CommitI
D
,
ArchivePrefix
string
}{
repoPath
(
t
),
archivePath
,
"c7fbe50c7c7419d9701eebe64b1fdacc3df5b9dd"
,
...
...
upload_test.go
View file @
dc94ea82
...
...
@@ -21,18 +21,18 @@ import (
"github.com/stretchr/testify/require"
)
type
uploadArtifactsFunction
func
(
url
,
contentType
string
,
body
io
.
Reader
)
(
*
http
.
Response
,
error
,
string
)
type
uploadArtifactsFunction
func
(
url
,
contentType
string
,
body
io
.
Reader
)
(
*
http
.
Response
,
string
,
error
)
func
uploadArtifactsV1
(
url
,
contentType
string
,
body
io
.
Reader
)
(
*
http
.
Response
,
error
,
string
)
{
func
uploadArtifactsV1
(
url
,
contentType
string
,
body
io
.
Reader
)
(
*
http
.
Response
,
string
,
error
)
{
resource
:=
`/ci/api/v1/builds/123/artifacts`
resp
,
err
:=
http
.
Post
(
url
+
resource
,
contentType
,
body
)
return
resp
,
err
,
resource
return
resp
,
resource
,
err
}
func
uploadArtifactsV4
(
url
,
contentType
string
,
body
io
.
Reader
)
(
*
http
.
Response
,
error
,
string
)
{
func
uploadArtifactsV4
(
url
,
contentType
string
,
body
io
.
Reader
)
(
*
http
.
Response
,
string
,
error
)
{
resource
:=
`/api/v4/jobs/123/artifacts`
resp
,
err
:=
http
.
Post
(
url
+
resource
,
contentType
,
body
)
return
resp
,
err
,
resource
return
resp
,
resource
,
err
}
func
testArtifactsUpload
(
t
*
testing
.
T
,
uploadArtifacts
uploadArtifactsFunction
)
{
...
...
@@ -45,7 +45,7 @@ func testArtifactsUpload(t *testing.T, uploadArtifacts uploadArtifactsFunction)
ws
:=
startWorkhorseServer
(
ts
.
URL
)
defer
ws
.
Close
()
resp
,
err
,
resource
:=
uploadArtifacts
(
ws
.
URL
,
contentType
,
reqBody
)
resp
,
resource
,
err
:=
uploadArtifacts
(
ws
.
URL
,
contentType
,
reqBody
)
assert
.
NoError
(
t
,
err
)
defer
resp
.
Body
.
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