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
e0a8447e
Commit
e0a8447e
authored
Mar 28, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-workhorse-test' into 'master'
Make all workhorse gitaly calls opt-out, take 2 See merge request gitlab-org/gitlab-ce!18043
parents
c23945a3
23936ff2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
10 deletions
+18
-10
.flayignore
.flayignore
+1
-0
workhorse-gitaly-mandatory.yml
changelogs/unreleased/workhorse-gitaly-mandatory.yml
+5
-0
workhorse.rb
lib/gitlab/workhorse.rb
+4
-4
workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+4
-4
gitaly.rb
spec/support/gitaly.rb
+4
-2
No files found.
.flayignore
View file @
e0a8447e
...
...
@@ -8,3 +8,4 @@ lib/gitlab/redis/*.rb
lib/gitlab/gitaly_client/operation_service.rb
lib/gitlab/background_migration/*
app/models/project_services/kubernetes_service.rb
lib/gitlab/workhorse.rb
changelogs/unreleased/workhorse-gitaly-mandatory.yml
0 → 100644
View file @
e0a8447e
---
title
:
Make all workhorse gitaly calls opt-out, take 2
merge_request
:
18043
author
:
type
:
other
lib/gitlab/workhorse.rb
View file @
e0a8447e
...
...
@@ -42,7 +42,7 @@ module Gitlab
end
def
send_git_blob
(
repository
,
blob
)
params
=
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_raw_show
)
params
=
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_raw_show
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
{
'GitalyServer'
=>
gitaly_server_hash
(
repository
),
'GetBlobRequest'
=>
{
...
...
@@ -70,7 +70,7 @@ module Gitlab
params
=
repository
.
archive_metadata
(
ref
,
Gitlab
.
config
.
gitlab
.
repository_downloads_path
,
format
)
raise
"Repository or ref not found"
if
params
.
empty?
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_archive
)
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_archive
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
params
.
merge!
(
'GitalyServer'
=>
gitaly_server_hash
(
repository
),
'GitalyRepository'
=>
repository
.
gitaly_repository
.
to_h
...
...
@@ -87,7 +87,7 @@ module Gitlab
end
def
send_git_diff
(
repository
,
diff_refs
)
params
=
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_send_git_diff
)
params
=
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_send_git_diff
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
{
'GitalyServer'
=>
gitaly_server_hash
(
repository
),
'RawDiffRequest'
=>
Gitaly
::
RawDiffRequest
.
new
(
...
...
@@ -105,7 +105,7 @@ module Gitlab
end
def
send_git_patch
(
repository
,
diff_refs
)
params
=
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_send_git_patch
)
params
=
if
Gitlab
::
GitalyClient
.
feature_enabled?
(
:workhorse_send_git_patch
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
{
'GitalyServer'
=>
gitaly_server_hash
(
repository
),
'RawPatchRequest'
=>
Gitaly
::
RawPatchRequest
.
new
(
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
e0a8447e
...
...
@@ -55,7 +55,7 @@ describe Gitlab::Workhorse do
end
end
context
'when Gitaly workhorse_archive feature is disabled'
,
:
skip_gitaly_mock
do
context
'when Gitaly workhorse_archive feature is disabled'
,
:
disable_gitaly
do
it
'sets the header correctly'
do
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
...
...
@@ -100,7 +100,7 @@ describe Gitlab::Workhorse do
end
end
context
'when Gitaly workhorse_send_git_patch feature is disabled'
,
:
skip_gitaly_mock
do
context
'when Gitaly workhorse_send_git_patch feature is disabled'
,
:
disable_gitaly
do
it
'sets the header correctly'
do
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
...
...
@@ -173,7 +173,7 @@ describe Gitlab::Workhorse do
end
end
context
'when Gitaly workhorse_send_git_diff feature is disabled'
,
:
skip_gitaly_mock
do
context
'when Gitaly workhorse_send_git_diff feature is disabled'
,
:
disable_gitaly
do
it
'sets the header correctly'
do
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
...
...
@@ -452,7 +452,7 @@ describe Gitlab::Workhorse do
end
end
context
'when Gitaly workhorse_raw_show feature is disabled'
,
:
skip_gitaly_mock
do
context
'when Gitaly workhorse_raw_show feature is disabled'
,
:
disable_gitaly
do
it
'sets the header correctly'
do
key
,
command
,
params
=
decode_workhorse_header
(
subject
)
...
...
spec/support/gitaly.rb
View file @
e0a8447e
RSpec
.
configure
do
|
config
|
config
.
before
(
:each
)
do
|
example
|
if
example
.
metadata
[
:disable_gitaly
]
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_return
(
false
)
# Use 'and_wrap_original' to make sure the arguments are valid
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_wrap_original
{
|
m
,
*
args
|
m
.
call
(
*
args
)
&&
false
}
else
next
if
example
.
metadata
[
:skip_gitaly_mock
]
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_return
(
true
)
# Use 'and_wrap_original' to make sure the arguments are valid
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_wrap_original
{
|
m
,
*
args
|
m
.
call
(
*
args
)
||
true
}
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