Commit 11a1dc12 authored by Michael Kozono's avatar Michael Kozono

Merge branch '36096-geo-make-project-designs-repository-general-available' into 'master'

Geo - Make design repository synchronization general available

Closes #36096

See merge request gitlab-org/gitlab!22544
parents 67e3add6 e7a362bd
...@@ -129,11 +129,11 @@ successfully, you must replicate their data using some other means. ...@@ -129,11 +129,11 @@ successfully, you must replicate their data using some other means.
| Application data in PostgreSQL | **Yes** | **Yes** | | | Application data in PostgreSQL | **Yes** | **Yes** | |
| Project repository | **Yes** | **Yes** | | | Project repository | **Yes** | **Yes** | |
| Project wiki repository | **Yes** | **Yes** | | | Project wiki repository | **Yes** | **Yes** | |
| Project designs repository | **Yes** | [No][design-verification] | Behind feature flag (*1*) | | Project designs repository | **Yes** | [No][design-verification] | |
| Uploads | **Yes** | [No][upload-verification] | Verified only on transfer, or manually (*2*)| | Uploads | **Yes** | [No][upload-verification] | Verified only on transfer, or manually (*1*)|
| LFS objects | **Yes** | [No][lfs-verification] | Verified only on transfer, or manually (*2*)| | LFS objects | **Yes** | [No][lfs-verification] | Verified only on transfer, or manually (*1*)|
| CI job artifacts (other than traces) | **Yes** | [No][artifact-verification] | Verified only manually (*2*) | | CI job artifacts (other than traces) | **Yes** | [No][artifact-verification] | Verified only manually (*1*) |
| Archived traces | **Yes** | [No][artifact-verification] | Verified only on transfer, or manually (*2*)| | Archived traces | **Yes** | [No][artifact-verification] | Verified only on transfer, or manually (*1*)|
| Personal snippets | **Yes** | **Yes** | | | Personal snippets | **Yes** | **Yes** | |
| Project snippets | **Yes** | **Yes** | | | Project snippets | **Yes** | **Yes** | |
| Object pools for forked project deduplication | **Yes** | No | | | Object pools for forked project deduplication | **Yes** | No | |
...@@ -147,13 +147,7 @@ successfully, you must replicate their data using some other means. ...@@ -147,13 +147,7 @@ successfully, you must replicate their data using some other means.
| [External merge request diffs][merge-request-diffs] | [No][diffs-replication] | No | | | [External merge request diffs][merge-request-diffs] | [No][diffs-replication] | No | |
| Content in object storage | **Yes** | No | | | Content in object storage | **Yes** | No | |
- (*1*): Enable the `enable_geo_design_sync` feature flag by running the following in a Rails console: - (*1*): The integrity can be verified manually using
```ruby
Feature.disable(:enable_geo_design_sync)
```
- (*2*): The integrity can be verified manually using
[Integrity Check Rake Task](../../raketasks/check.md) on both nodes and comparing the output between them. [Integrity Check Rake Task](../../raketasks/check.md) on both nodes and comparing the output between them.
[design-replication]: https://gitlab.com/groups/gitlab-org/-/epics/1633 [design-replication]: https://gitlab.com/groups/gitlab-org/-/epics/1633
......
...@@ -3,10 +3,6 @@ ...@@ -3,10 +3,6 @@
class Admin::Geo::DesignsController < Admin::Geo::ApplicationController class Admin::Geo::DesignsController < Admin::Geo::ApplicationController
before_action :check_license! before_action :check_license!
before_action do
push_frontend_feature_flag(:enable_geo_design_sync)
end
def index def index
end end
end end
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
class Admin::Geo::NodesController < Admin::Geo::ApplicationController class Admin::Geo::NodesController < Admin::Geo::ApplicationController
before_action :check_license!, except: :index before_action :check_license!, except: :index
before_action :load_node, only: [:edit, :update] before_action :load_node, only: [:edit, :update]
before_action only: [:index] do
push_frontend_feature_flag(:enable_geo_design_sync)
end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
......
...@@ -7,8 +7,6 @@ module Geo ...@@ -7,8 +7,6 @@ module Geo
private private
def sync_repository def sync_repository
return if Feature.disabled?(:enable_geo_design_sync)
start_registry_sync! start_registry_sync!
fetch_repository fetch_repository
mark_sync_as_successful mark_sync_as_successful
......
...@@ -16,7 +16,6 @@ module Geo ...@@ -16,7 +16,6 @@ module Geo
def execute def execute
return false unless Gitlab::Geo.primary? return false unless Gitlab::Geo.primary?
return false if design? && Feature.disabled?(:enable_geo_design_sync)
reset_repository_checksum! reset_repository_checksum!
create_repository_updated_event! create_repository_updated_event!
......
...@@ -22,11 +22,10 @@ ...@@ -22,11 +22,10 @@
= link_to admin_geo_projects_path, title: 'Projects' do = link_to admin_geo_projects_path, title: 'Projects' do
%span %span
= _('Projects') = _('Projects')
- if Feature.enabled?(:enable_geo_design_sync) = nav_link(path: 'admin/geo/designs#index') do
= nav_link(path: 'admin/geo/designs#index') do = link_to admin_geo_designs_path, title: _('Designs') do
= link_to admin_geo_designs_path, title: _('Designs') do %span
%span = _('Designs')
= _('Designs')
= nav_link(path: 'admin/geo/uploads#index') do = nav_link(path: 'admin/geo/uploads#index') do
= link_to admin_geo_uploads_path, title: 'Uploads' do = link_to admin_geo_uploads_path, title: 'Uploads' do
%span %span
......
...@@ -15,10 +15,7 @@ module Geo ...@@ -15,10 +15,7 @@ module Geo
end end
def perform(project_id) def perform(project_id)
return if Feature.disabled?(:enable_geo_design_sync)
registry = Geo::DesignRegistry.find_or_initialize_by(project_id: project_id) # rubocop: disable CodeReuse/ActiveRecord registry = Geo::DesignRegistry.find_or_initialize_by(project_id: project_id) # rubocop: disable CodeReuse/ActiveRecord
project = registry.project project = registry.project
if project.nil? if project.nil?
......
---
title: Geo - Replicate project designs repositories
merge_request: 22544
author:
type: added
...@@ -29,10 +29,6 @@ module Gitlab ...@@ -29,10 +29,6 @@ module Gitlab
end end
end end
def skippable?
Feature.disabled?(:enable_geo_design_sync)
end
def log_event(job_id) def log_event(job_id)
logger.event_info( logger.event_info(
created_at, created_at,
......
...@@ -339,12 +339,10 @@ namespace :geo do ...@@ -339,12 +339,10 @@ namespace :geo do
puts using_percentage(current_node_status.container_repositories_synced_in_percentage) puts using_percentage(current_node_status.container_repositories_synced_in_percentage)
end end
if Feature.enabled?(:enable_geo_design_sync) print 'Design repositories: '.rjust(GEO_STATUS_COLUMN_WIDTH)
print 'Design repositories: '.rjust(GEO_STATUS_COLUMN_WIDTH) show_failed_value(current_node_status.design_repositories_failed_count)
show_failed_value(current_node_status.design_repositories_failed_count) print "#{current_node_status.design_repositories_synced_count || 0}/#{current_node_status.design_repositories_count || 0} "
print "#{current_node_status.design_repositories_synced_count || 0}/#{current_node_status.design_repositories_count || 0} " puts using_percentage(current_node_status.design_repositories_synced_in_percentage)
puts using_percentage(current_node_status.design_repositories_synced_in_percentage)
end
if Gitlab::CurrentSettings.repository_checks_enabled if Gitlab::CurrentSettings.repository_checks_enabled
print 'Repositories Checked: '.rjust(GEO_STATUS_COLUMN_WIDTH) print 'Repositories Checked: '.rjust(GEO_STATUS_COLUMN_WIDTH)
......
...@@ -36,53 +36,31 @@ describe Gitlab::Geo::LogCursor::Events::DesignRepositoryUpdatedEvent, :clean_gi ...@@ -36,53 +36,31 @@ describe Gitlab::Geo::LogCursor::Events::DesignRepositoryUpdatedEvent, :clean_gi
end end
describe '#process' do describe '#process' do
context 'when the feature flag is disabled' do context 'when the associated shard is healthy' do
before do before do
stub_feature_flags(enable_geo_design_sync: false) allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(true)
end end
it 'does not create a design registry' do it_behaves_like 'DesignRepositoryUpdatedEvent'
expect { subject.process }.not_to change(Geo::DesignRegistry, :count)
end
it 'does not schedule a Geo::DesignRepositorySyncWorker job' do it 'schedules a Geo::DesignRepositorySyncWorker' do
expect(Geo::DesignRepositorySyncWorker).not_to receive(:perform_async).with(project.id) expect(Geo::DesignRepositorySyncWorker).to receive(:perform_async).with(project.id).once
subject.process subject.process
end end
end end
context 'when the feature flag is disabled' do context 'when associated shard is unhealthy' do
before do before do
stub_feature_flags(enable_geo_design_sync: true) allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(false)
end
context 'when the associated shard is healthy' do
before do
allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(true)
end
it_behaves_like 'DesignRepositoryUpdatedEvent'
it 'schedules a Geo::DesignRepositorySyncWorker' do
expect(Geo::DesignRepositorySyncWorker).to receive(:perform_async).with(project.id).once
subject.process
end
end end
context 'when associated shard is unhealthy' do it_behaves_like 'DesignRepositoryUpdatedEvent'
before do
allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(false)
end
it_behaves_like 'DesignRepositoryUpdatedEvent'
it 'does not schedule a Geo::DesignRepositorySyncWorker job' do it 'does not schedule a Geo::DesignRepositorySyncWorker job' do
expect(Geo::DesignRepositorySyncWorker).not_to receive(:perform_async).with(project.id) expect(Geo::DesignRepositorySyncWorker).not_to receive(:perform_async).with(project.id)
subject.process subject.process
end
end end
end end
end end
......
...@@ -94,12 +94,6 @@ describe Geo::RepositoryUpdatedService do ...@@ -94,12 +94,6 @@ describe Geo::RepositoryUpdatedService do
it 'creates a design repository updated event' do it 'creates a design repository updated event' do
expect { subject.execute }.to change(Geo::RepositoryUpdatedEvent, :count).by(1) expect { subject.execute }.to change(Geo::RepositoryUpdatedEvent, :count).by(1)
end end
it 'does not create a design repository updated event when feature is disabled' do
stub_feature_flags(enable_geo_design_sync: false)
expect { subject.execute }.not_to change(Geo::RepositoryUpdatedEvent, :count)
end
end end
end end
end end
...@@ -15,16 +15,6 @@ describe Geo::DesignRepositorySyncWorker, :geo do ...@@ -15,16 +15,6 @@ describe Geo::DesignRepositorySyncWorker, :geo do
expect(service).to have_received(:execute) expect(service).to have_received(:execute)
end end
it 'does not run DesignRepositorySyncService if feature is disabled' do
project = create(:project)
stub_feature_flags(enable_geo_design_sync: false)
expect(Geo::DesignRepositorySyncService).not_to receive(:new)
described_class.new.perform(project.id)
end
it 'logs error when repository does not exist' do it 'logs error when repository does not exist' do
worker = described_class.new worker = described_class.new
......
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