Commit eee43854 authored by Sean McGivern's avatar Sean McGivern

Merge branch '4887-geo-improve-formatting-of-can-t-push-to-secondary-warning-message' into 'master'

Resolve "Geo: Improve formatting of can't push to secondary warning message"

Closes #4887

See merge request gitlab-org/gitlab-ee!4616
parents 94220238 f180315c
---
title: 'Geo: Improve formatting of can''t push to secondary warning message'
merge_request:
author:
type: changed
...@@ -18,7 +18,7 @@ module EE ...@@ -18,7 +18,7 @@ module EE
message = super message = super
if ::Gitlab::Geo.secondary_with_primary? if ::Gitlab::Geo.secondary_with_primary?
message += " Please use the Primary node URL: #{geo_primary_url_to_repo}. Documentation: #{GEO_SERVER_DOCS_URL}" message += "\nPlease use the primary node URL instead: #{geo_primary_url_to_repo}.\nFor more information: #{GEO_SERVER_DOCS_URL}"
end end
message message
......
...@@ -25,8 +25,9 @@ describe Gitlab::GitAccess do ...@@ -25,8 +25,9 @@ describe Gitlab::GitAccess do
end end
it 'denies push access with primary present' do it 'denies push access with primary present' do
error_message = "You can't push code to a read-only GitLab instance. "\ error_message = "You can't push code to a read-only GitLab instance."\
"Please use the Primary node URL: https://localhost:3000/gitlab/#{project.full_path}.git. Documentation: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}" "\nPlease use the primary node URL instead: https://localhost:3000/gitlab/#{project.full_path}.git.
For more information: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}"
primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab') primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab')
allow(Gitlab::Geo).to receive(:primary).and_return(primary_node) allow(Gitlab::Geo).to receive(:primary).and_return(primary_node)
......
...@@ -29,8 +29,10 @@ describe Gitlab::GitAccessWiki do ...@@ -29,8 +29,10 @@ describe Gitlab::GitAccessWiki do
end end
it 'denies push access with primary present' do it 'denies push access with primary present' do
error_message = "You can't push code to a read-only GitLab instance. Please use the Primary node URL: "\ error_message = "You can't push code to a read-only GitLab instance.
"https://localhost:3000/gitlab/#{project.full_path}.wiki.git. Documentation: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}" Please use the primary node URL instead: "\
"https://localhost:3000/gitlab/#{project.full_path}.wiki.git.
For more information: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}"
primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab') primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab')
allow(Gitlab::Geo).to receive(:primary).and_return(primary_node) allow(Gitlab::Geo).to receive(:primary).and_return(primary_node)
......
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