Commit 74ab847a authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '329818-geo-beta-fix-data-types' into 'master'

Geo 2.0 Regression - Data Types

See merge request gitlab-org/gitlab!61409
parents cb865727 57143b07
...@@ -223,8 +223,8 @@ module EE ...@@ -223,8 +223,8 @@ module EE
enabled_replicator_classes.each do |replicator_class| enabled_replicator_classes.each do |replicator_class|
replicable_types.push( replicable_types.push(
{ {
data_type: 'blob', data_type: replicator_class.data_type,
data_type_title: _('File'), data_type_title: replicator_class.data_type_title,
title: replicator_class.replicable_title, title: replicator_class.replicable_title,
title_plural: replicator_class.replicable_title_plural, title_plural: replicator_class.replicable_title_plural,
name: replicator_class.replicable_name, name: replicator_class.replicable_name,
......
...@@ -16,6 +16,14 @@ module Geo ...@@ -16,6 +16,14 @@ module Geo
def sync_timeout def sync_timeout
::Geo::BlobDownloadService::LEASE_TIMEOUT ::Geo::BlobDownloadService::LEASE_TIMEOUT
end end
def data_type
'blob'
end
def data_type_title
_('File')
end
end end
def handle_after_create_commit def handle_after_create_commit
......
...@@ -17,6 +17,14 @@ module Geo ...@@ -17,6 +17,14 @@ module Geo
def sync_timeout def sync_timeout
::Geo::FrameworkRepositorySyncService::LEASE_TIMEOUT ::Geo::FrameworkRepositorySyncService::LEASE_TIMEOUT
end end
def data_type
'repository'
end
def data_type_title
_('Git')
end
end end
# Called by Gitlab::Geo::Replicator#consume # Called by Gitlab::Geo::Replicator#consume
......
...@@ -21,7 +21,7 @@ RSpec.describe EE::GeoHelper do ...@@ -21,7 +21,7 @@ RSpec.describe EE::GeoHelper do
end end
end end
describe 'replicable_types' do describe '#replicable_types' do
subject(:names) { helper.replicable_types.map { |t| t[:name_plural] } } subject(:names) { helper.replicable_types.map { |t| t[:name_plural] } }
it 'includes legacy types' do it 'includes legacy types' do
...@@ -43,5 +43,19 @@ RSpec.describe EE::GeoHelper do ...@@ -43,5 +43,19 @@ RSpec.describe EE::GeoHelper do
expect(names).to include(*expected_names) expect(names).to include(*expected_names)
end end
it 'includes replicator data types' do
data_types = helper.replicable_types.map { |t| t[:data_type] }
expected_data_types = helper.enabled_replicator_classes.map { |c| c.data_type }
expect(data_types).to include(*expected_data_types)
end
it 'includes replicator data type titles' do
data_type_titles = helper.replicable_types.map { |t| t[:data_type_title] }
expected_data_type_titles = helper.enabled_replicator_classes.map { |c| c.data_type_title }
expect(data_type_titles).to include(*expected_data_type_titles)
end
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