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
fe55e180
Commit
fe55e180
authored
Feb 02, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the primary version and revision being incorrect on Geo secondaries
parent
b62ef094
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
ee/app/helpers/ee/geo_helper.rb
ee/app/helpers/ee/geo_helper.rb
+19
-0
ee/app/views/admin/geo_nodes/index.html.haml
ee/app/views/admin/geo_nodes/index.html.haml
+1
-1
spec/ee/spec/models/geo_node_status_spec.rb
spec/ee/spec/models/geo_node_status_spec.rb
+1
-1
spec/requests/api/geo_nodes_spec.rb
spec/requests/api/geo_nodes_spec.rb
+1
-0
No files found.
ee/app/helpers/ee/geo_helper.rb
View file @
fe55e180
module
EE
module
GeoHelper
def
node_vue_list_properties
version
,
revision
=
if
::
Gitlab
::
Geo
.
primary?
[
::
Gitlab
::
VERSION
,
::
Gitlab
::
REVISION
]
else
status
=
::
Gitlab
::
Geo
.
primary_node
&
.
status
[
status
&
.
version
,
status
&
.
revision
]
end
{
primary_version:
version
.
to_s
,
primary_revision:
revision
.
to_s
,
node_details_path:
admin_geo_nodes_path
.
to_s
,
node_actions_allowed:
::
Gitlab
::
Database
.
read_write?
.
to_s
,
node_edit_allowed:
::
Gitlab
::
Geo
.
license_allows?
.
to_s
}
end
def
node_namespaces_options
(
namespaces
)
namespaces
.
map
{
|
g
|
{
id:
g
.
id
,
text:
g
.
full_name
}
}
end
...
...
ee/app/views/admin/geo_nodes/index.html.haml
View file @
fe55e180
...
...
@@ -23,6 +23,6 @@
.alert.alert-warning
WARNING: Please upgrade PostgreSQL to version 9.6 or greater. The status of the replication cannot be determined reliably with the current version.
-
if
@nodes
.
any?
#js-geo-nodes
{
data:
{
primary_version:
"#{Gitlab::VERSION}"
,
primary_revision:
"#{Gitlab::REVISION}"
,
node_details_path:
"#{admin_geo_nodes_path}"
,
node_actions_allowed:
"#{Gitlab::Database.read_write?}"
,
node_edit_allowed:
"#{Gitlab::Geo.license_allows?}"
}
}
#js-geo-nodes
{
data:
node_vue_list_properties
}
-
else
=
render
'shared/empty_states/geo'
spec/ee/spec/models/geo_node_status_spec.rb
View file @
fe55e180
...
...
@@ -426,7 +426,7 @@ describe GeoNodeStatus, :geo do
end
describe
'#version'
do
it
{
expect
(
status
.
version
).
to
eq
(
Gitlab
::
VERSION
)
}
it
{
expect
(
status
.
version
).
to
eq
(
Gitlab
::
VERSION
)
}
end
describe
'#revision'
do
...
...
spec/requests/api/geo_nodes_spec.rb
View file @
fe55e180
...
...
@@ -89,6 +89,7 @@ describe API::GeoNodes, :geo, api: true do
it
'fetches the current node status'
do
stub_current_geo_node
(
secondary
)
expect
(
GeoNode
).
to
receive
(
:find
).
and_return
(
secondary
)
expect
(
GeoNodeStatus
).
to
receive
(
:current_node_status
).
and_call_original
...
...
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