Commit 8e3de7bb authored by Ash McKenzie's avatar Ash McKenzie

CustomAction#message was never used

parent e30e9a9b
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment