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
6c06d9fb
Commit
6c06d9fb
authored
Oct 16, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Rails console message fix
Geo: Rails console message display primary/secondary state incorrectly
parent
562618d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
1 deletion
+45
-1
config/initializers/console_message.rb
config/initializers/console_message.rb
+1
-1
ee/app/helpers/ee/geo_helper.rb
ee/app/helpers/ee/geo_helper.rb
+7
-0
ee/changelogs/unreleased/7963-geo-rails-console-message-display-primary-secondary-state-incorrectly.yml
...e-message-display-primary-secondary-state-incorrectly.yml
+5
-0
ee/spec/helpers/ee/geo_helper_spec.rb
ee/spec/helpers/ee/geo_helper_spec.rb
+23
-0
locale/gitlab.pot
locale/gitlab.pot
+9
-0
No files found.
config/initializers/console_message.rb
View file @
6c06d9fb
...
...
@@ -10,7 +10,7 @@ if defined?(Rails::Console)
# EE-specific start
if
Gitlab
::
Geo
.
enabled?
puts
" Geo enabled:"
.
ljust
(
justify
)
+
'yes'
puts
" Geo server:"
.
ljust
(
justify
)
+
(
Gitlab
::
Geo
.
primary?
?
'primary'
:
'secondary'
)
puts
" Geo server:"
.
ljust
(
justify
)
+
EE
::
GeoHelper
.
current_node_human_status
end
# EE specific end
...
...
ee/app/helpers/ee/geo_helper.rb
View file @
6c06d9fb
...
...
@@ -9,6 +9,13 @@ module EE
never:
'circle-o'
}.
freeze
def
self
.
current_node_human_status
return
s_
(
'Geo|primary'
)
if
::
Gitlab
::
Geo
.
primary?
return
s_
(
'Geo|secondary'
)
if
::
Gitlab
::
Geo
.
secondary?
s_
(
'Geo|misconfigured'
)
end
def
node_vue_list_properties
version
,
revision
=
if
::
Gitlab
::
Geo
.
primary?
...
...
ee/changelogs/unreleased/7963-geo-rails-console-message-display-primary-secondary-state-incorrectly.yml
0 → 100644
View file @
6c06d9fb
---
title
:
'
Geo:
Rails
console
message
display
primary/secondary
state
incorrectly'
merge_request
:
author
:
type
:
fixed
ee/spec/helpers/ee/geo_helper_spec.rb
0 → 100644
View file @
6c06d9fb
# frozen_string_literal: true
require
'spec_helper'
describe
EE
::
GeoHelper
do
describe
'.current_node_human_status'
do
where
(
:primary
,
:secondary
,
:result
)
do
[
[
true
,
false
,
'primary'
],
[
false
,
true
,
'secondary'
],
[
false
,
false
,
'misconfigured'
]
]
end
with_them
do
it
'returns correct results'
do
allow
(
::
Gitlab
::
Geo
).
to
receive
(
:primary?
).
and_return
(
primary
)
allow
(
::
Gitlab
::
Geo
).
to
receive
(
:secondary?
).
and_return
(
secondary
)
expect
(
described_class
.
current_node_human_status
).
to
eq
result
end
end
end
end
locale/gitlab.pot
View file @
6c06d9fb
...
...
@@ -3768,6 +3768,15 @@ msgstr ""
msgid "Geo|You need a different license to use Geo replication"
msgstr ""
msgid "Geo|misconfigured"
msgstr ""
msgid "Geo|primary"
msgstr ""
msgid "Geo|secondary"
msgstr ""
msgid "Get a free instance review"
msgstr ""
...
...
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