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
8e3de7bb
Commit
8e3de7bb
authored
Sep 11, 2019
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CustomAction#message was never used
parent
e30e9a9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
10 deletions
+8
-10
ee/lib/ee/gitlab/geo_git_access.rb
ee/lib/ee/gitlab/geo_git_access.rb
+1
-1
ee/spec/support/shared_examples/git_access_shared_examples.rb
...pec/support/shared_examples/git_access_shared_examples.rb
+1
-1
lib/api/internal/base.rb
lib/api/internal/base.rb
+1
-1
lib/gitlab/git_access_result/custom_action.rb
lib/gitlab/git_access_result/custom_action.rb
+2
-3
spec/requests/api/internal/base_spec.rb
spec/requests/api/internal/base_spec.rb
+3
-4
No files found.
ee/lib/ee/gitlab/geo_git_access.rb
View file @
8e3de7bb
...
@@ -51,7 +51,7 @@ module EE
...
@@ -51,7 +51,7 @@ module EE
}
}
}
}
::
Gitlab
::
GitAccessResult
::
CustomAction
.
new
(
payload
,
'Attempting to proxy to primary.'
,
messages
)
::
Gitlab
::
GitAccessResult
::
CustomAction
.
new
(
payload
,
messages
)
end
end
def
messages
def
messages
...
...
ee/spec/support/shared_examples/git_access_shared_examples.rb
View file @
8e3de7bb
...
@@ -50,8 +50,8 @@ shared_examples 'a read-only GitLab instance' do
...
@@ -50,8 +50,8 @@ shared_examples 'a read-only GitLab instance' do
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
expect
(
push_changes
).
to
be_a
(
Gitlab
::
GitAccessResult
::
CustomAction
)
expect
(
push_changes
).
to
be_a
(
Gitlab
::
GitAccessResult
::
CustomAction
)
expect
(
push_changes
.
message
).
to
eql
(
'Attempting to proxy to primary.'
)
expect
(
push_changes
.
payload
).
to
eql
(
payload
)
expect
(
push_changes
.
payload
).
to
eql
(
payload
)
expect
(
push_changes
.
console_messages
).
to
include
(
*
console_messages
)
end
end
end
end
end
end
...
...
lib/api/internal/base.rb
View file @
8e3de7bb
...
@@ -77,7 +77,7 @@ module API
...
@@ -77,7 +77,7 @@ module API
response_with_status
(
**
payload
)
response_with_status
(
**
payload
)
when
::
Gitlab
::
GitAccessResult
::
CustomAction
when
::
Gitlab
::
GitAccessResult
::
CustomAction
response_with_status
(
code:
300
,
message:
check_result
.
message
,
payload:
check_result
.
payload
,
gl_console_messages:
check_result
.
console_messages
)
response_with_status
(
code:
300
,
payload:
check_result
.
payload
,
gl_console_messages:
check_result
.
console_messages
)
else
else
response_with_status
(
code:
500
,
success:
false
,
message:
UNKNOWN_CHECK_RESULT_ERROR
)
response_with_status
(
code:
500
,
success:
false
,
message:
UNKNOWN_CHECK_RESULT_ERROR
)
end
end
...
...
lib/gitlab/git_access_result/custom_action.rb
View file @
8e3de7bb
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Gitlab
module
GitAccessResult
module
GitAccessResult
class
CustomAction
class
CustomAction
attr_reader
:payload
,
:
message
,
:
console_messages
attr_reader
:payload
,
:console_messages
# Example of payload:
# Example of payload:
#
#
...
@@ -16,9 +16,8 @@ module Gitlab
...
@@ -16,9 +16,8 @@ module Gitlab
# }
# }
# }
# }
#
#
def
initialize
(
payload
,
message
,
console_messages
)
def
initialize
(
payload
,
console_messages
)
@payload
=
payload
@payload
=
payload
@message
=
message
@console_messages
=
console_messages
@console_messages
=
console_messages
end
end
end
end
...
...
spec/requests/api/internal/base_spec.rb
View file @
8e3de7bb
...
@@ -407,7 +407,6 @@ describe API::Internal::Base do
...
@@ -407,7 +407,6 @@ describe API::Internal::Base do
context
"custom action"
do
context
"custom action"
do
let
(
:access_checker
)
{
double
(
Gitlab
::
GitAccess
)
}
let
(
:access_checker
)
{
double
(
Gitlab
::
GitAccess
)
}
let
(
:message
)
{
'CustomActionError message'
}
let
(
:payload
)
do
let
(
:payload
)
do
{
{
'action'
=>
'geo_proxy_to_primary'
,
'action'
=>
'geo_proxy_to_primary'
,
...
@@ -418,8 +417,8 @@ describe API::Internal::Base do
...
@@ -418,8 +417,8 @@ describe API::Internal::Base do
}
}
}
}
end
end
let
(
:console_messages
)
{
[
'informational message'
]
}
let
(
:custom_action_result
)
{
Gitlab
::
GitAccessResult
::
CustomAction
.
new
(
payload
,
message
)
}
let
(
:custom_action_result
)
{
Gitlab
::
GitAccessResult
::
CustomAction
.
new
(
payload
,
console_messages
)
}
before
do
before
do
project
.
add_guest
(
user
)
project
.
add_guest
(
user
)
...
@@ -446,8 +445,8 @@ describe API::Internal::Base do
...
@@ -446,8 +445,8 @@ describe API::Internal::Base do
expect
(
response
).
to
have_gitlab_http_status
(
300
)
expect
(
response
).
to
have_gitlab_http_status
(
300
)
expect
(
json_response
[
'status'
]).
to
be_truthy
expect
(
json_response
[
'status'
]).
to
be_truthy
expect
(
json_response
[
'message'
]).
to
eql
(
message
)
expect
(
json_response
[
'payload'
]).
to
eql
(
payload
)
expect
(
json_response
[
'payload'
]).
to
eql
(
payload
)
expect
(
json_response
[
'gl_console_messages'
]).
to
eql
(
console_messages
)
expect
(
user
.
reload
.
last_activity_on
).
to
be_nil
expect
(
user
.
reload
.
last_activity_on
).
to
be_nil
end
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