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
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-ce
Commits
85d88d67
Commit
85d88d67
authored
Aug 28, 2019
by
Jacob Vosmaer
Committed by
Michael Kozono
Aug 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support Gitaly feature flags in workhorse
parent
c21c3c6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
3 deletions
+25
-3
GITLAB_WORKHORSE_VERSION
GITLAB_WORKHORSE_VERSION
+1
-1
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+4
-2
spec/lib/gitlab/workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+13
-0
spec/requests/api/project_snapshots_spec.rb
spec/requests/api/project_snapshots_spec.rb
+7
-0
No files found.
GITLAB_WORKHORSE_VERSION
View file @
85d88d67
8.
8
.0
8.
9
.0
lib/gitlab/workhorse.rb
View file @
85d88d67
...
@@ -34,7 +34,8 @@ module Gitlab
...
@@ -34,7 +34,8 @@ module Gitlab
GitConfigOptions
:
[],
GitConfigOptions
:
[],
GitalyServer
:
{
GitalyServer
:
{
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
),
features:
Feature
::
Gitaly
.
server_feature_flags
}
}
}
}
...
@@ -250,7 +251,8 @@ module Gitlab
...
@@ -250,7 +251,8 @@ module Gitlab
def
gitaly_server_hash
(
repository
)
def
gitaly_server_hash
(
repository
)
{
{
address:
Gitlab
::
GitalyClient
.
address
(
repository
.
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
repository
.
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
repository
.
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
repository
.
project
.
repository_storage
),
features:
Feature
::
Gitaly
.
server_feature_flags
}
}
end
end
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
85d88d67
...
@@ -14,6 +14,12 @@ describe Gitlab::Workhorse do
...
@@ -14,6 +14,12 @@ describe Gitlab::Workhorse do
[
key
,
command
,
params
]
[
key
,
command
,
params
]
end
end
before
do
allow
(
Feature
::
Gitaly
).
to
receive
(
:server_feature_flags
).
and_return
({
'gitaly-feature-foobar'
=>
'true'
})
end
describe
".send_git_archive"
do
describe
".send_git_archive"
do
let
(
:ref
)
{
'master'
}
let
(
:ref
)
{
'master'
}
let
(
:format
)
{
'zip'
}
let
(
:format
)
{
'zip'
}
...
@@ -41,6 +47,7 @@ describe Gitlab::Workhorse do
...
@@ -41,6 +47,7 @@ describe Gitlab::Workhorse do
expected_params
=
metadata
.
merge
(
expected_params
=
metadata
.
merge
(
'GitalyRepository'
=>
repository
.
gitaly_repository
.
to_h
,
'GitalyRepository'
=>
repository
.
gitaly_repository
.
to_h
,
'GitalyServer'
=>
{
'GitalyServer'
=>
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
}
}
...
@@ -69,6 +76,7 @@ describe Gitlab::Workhorse do
...
@@ -69,6 +76,7 @@ describe Gitlab::Workhorse do
expect
(
command
).
to
eq
(
'git-archive'
)
expect
(
command
).
to
eq
(
'git-archive'
)
expect
(
params
).
to
eq
({
expect
(
params
).
to
eq
({
'GitalyServer'
=>
{
'GitalyServer'
=>
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
},
...
@@ -117,6 +125,7 @@ describe Gitlab::Workhorse do
...
@@ -117,6 +125,7 @@ describe Gitlab::Workhorse do
expect
(
command
).
to
eq
(
"git-format-patch"
)
expect
(
command
).
to
eq
(
"git-format-patch"
)
expect
(
params
).
to
eq
({
expect
(
params
).
to
eq
({
'GitalyServer'
=>
{
'GitalyServer'
=>
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
},
...
@@ -178,6 +187,7 @@ describe Gitlab::Workhorse do
...
@@ -178,6 +187,7 @@ describe Gitlab::Workhorse do
expect
(
command
).
to
eq
(
"git-diff"
)
expect
(
command
).
to
eq
(
"git-diff"
)
expect
(
params
).
to
eq
({
expect
(
params
).
to
eq
({
'GitalyServer'
=>
{
'GitalyServer'
=>
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
},
...
@@ -315,6 +325,7 @@ describe Gitlab::Workhorse do
...
@@ -315,6 +325,7 @@ describe Gitlab::Workhorse do
let
(
:gitaly_params
)
do
let
(
:gitaly_params
)
do
{
{
GitalyServer
:
{
GitalyServer
:
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
'default'
),
address:
Gitlab
::
GitalyClient
.
address
(
'default'
),
token:
Gitlab
::
GitalyClient
.
token
(
'default'
)
token:
Gitlab
::
GitalyClient
.
token
(
'default'
)
}
}
...
@@ -463,6 +474,7 @@ describe Gitlab::Workhorse do
...
@@ -463,6 +474,7 @@ describe Gitlab::Workhorse do
expect
(
command
).
to
eq
(
'git-blob'
)
expect
(
command
).
to
eq
(
'git-blob'
)
expect
(
params
).
to
eq
({
expect
(
params
).
to
eq
({
'GitalyServer'
=>
{
'GitalyServer'
=>
{
features:
{
'gitaly-feature-foobar'
=>
'true'
},
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
},
...
@@ -504,6 +516,7 @@ describe Gitlab::Workhorse do
...
@@ -504,6 +516,7 @@ describe Gitlab::Workhorse do
expect
(
command
).
to
eq
(
'git-snapshot'
)
expect
(
command
).
to
eq
(
'git-snapshot'
)
expect
(
params
).
to
eq
(
expect
(
params
).
to
eq
(
'GitalyServer'
=>
{
'GitalyServer'
=>
{
'features'
=>
{
'gitaly-feature-foobar'
=>
'true'
},
'address'
=>
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
'address'
=>
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
'token'
=>
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
'token'
=>
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
},
},
...
...
spec/requests/api/project_snapshots_spec.rb
View file @
85d88d67
...
@@ -6,6 +6,12 @@ describe API::ProjectSnapshots do
...
@@ -6,6 +6,12 @@ describe API::ProjectSnapshots do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:admin
)
{
create
(
:admin
)
}
before
do
allow
(
Feature
::
Gitaly
).
to
receive
(
:server_feature_flags
).
and_return
({
'gitaly-feature-foobar'
=>
'true'
})
end
describe
'GET /projects/:id/snapshot'
do
describe
'GET /projects/:id/snapshot'
do
def
expect_snapshot_response_for
(
repository
)
def
expect_snapshot_response_for
(
repository
)
type
,
params
=
workhorse_send_data
type
,
params
=
workhorse_send_data
...
@@ -13,6 +19,7 @@ describe API::ProjectSnapshots do
...
@@ -13,6 +19,7 @@ describe API::ProjectSnapshots do
expect
(
type
).
to
eq
(
'git-snapshot'
)
expect
(
type
).
to
eq
(
'git-snapshot'
)
expect
(
params
).
to
eq
(
expect
(
params
).
to
eq
(
'GitalyServer'
=>
{
'GitalyServer'
=>
{
'features'
=>
{
'gitaly-feature-foobar'
=>
'true'
},
'address'
=>
Gitlab
::
GitalyClient
.
address
(
repository
.
project
.
repository_storage
),
'address'
=>
Gitlab
::
GitalyClient
.
address
(
repository
.
project
.
repository_storage
),
'token'
=>
Gitlab
::
GitalyClient
.
token
(
repository
.
project
.
repository_storage
)
'token'
=>
Gitlab
::
GitalyClient
.
token
(
repository
.
project
.
repository_storage
)
},
},
...
...
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