As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 84d96bed authored by Luke Duncalfe's avatar Luke Duncalfe
Browse files

Rename print_broadbast method to be generic

print_warnings is now using that method in order to print a large
formatted warning message, so renaming the method to be less tied to
the broadcast message functionality.
parent c5eb9428
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -24,7 +24,7 @@ class GitlabPostReceive
end
return false unless response
print_broadcast_message(response['broadcast_message']) if response['broadcast_message']
print_formatted_alert_message(response['broadcast_message']) if response['broadcast_message']
print_merge_request_links(response['merge_request_urls']) if response['merge_request_urls']
puts response['redirected_message'] if response['redirected_message']
puts response['project_created_message'] if response['project_created_message']
Loading
Loading
@@ -62,10 +62,10 @@ class GitlabPostReceive
def print_warnings(warnings)
message = "WARNINGS:\n#{warnings}"
print_broadcast_message(message)
print_formatted_alert_message(message)
end
def print_broadcast_message(message)
def print_formatted_alert_message(message)
# A standard terminal window is (at least) 80 characters wide.
total_width = 80
Loading
Loading
Loading
Loading
@@ -108,7 +108,7 @@ describe GitlabPostReceive do
it 'treats the warning as a broadcast message' do
expect_any_instance_of(GitlabNet).to receive(:post_receive).and_return(response)
expect(gitlab_post_receive).to receive(:print_broadcast_message).with("WARNINGS:\nMy warning message")
expect(gitlab_post_receive).to receive(:print_formatted_alert_message).with("WARNINGS:\nMy warning message")
expect(gitlab_post_receive.exec).to eq(true)
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment