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.
| Application data in PostgreSQL | **Yes** | **Yes** | |
| Project repository | **Yes** | **Yes** | |
| Project wiki repository | **Yes** | **Yes** | |
| Project designs repository | **Yes** | [No][design-verification] | Behind feature flag (*1*) |
| Uploads | **Yes** | [No][upload-verification] | Verified only on transfer, or manually (*2*)|
| LFS objects | **Yes** | [No][lfs-verification] | Verified only on transfer, or manually (*2*)|
| CI job artifacts (other than traces) | **Yes** | [No][artifact-verification] | Verified only manually (*2*) |
| Archived traces | **Yes** | [No][artifact-verification] | Verified only on transfer, or manually (*2*)|
| Project designs repository | **Yes** | [No][design-verification] | |
| Uploads | **Yes** | [No][upload-verification] | Verified only on transfer, or manually (*1*)|
| 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 (*1*) |
| Archived traces | **Yes** | [No][artifact-verification] | Verified only on transfer, or manually (*1*)|
| Personal snippets | **Yes** | **Yes** | |
| Project snippets | **Yes** | **Yes** | |
| Object pools for forked project deduplication | **Yes** | No | |
......@@ -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 | |
| Content in object storage | **Yes** | No | |
- (*1*): Enable the `enable_geo_design_sync` feature flag by running the following in a Rails console:
```ruby
Feature.disable(:enable_geo_design_sync)
```
- (*2*): The integrity can be verified manually using
- (*1*): The integrity can be verified manually using
[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
......
......@@ -3,10 +3,6 @@
class Admin::Geo::DesignsController < Admin::Geo::ApplicationController
before_action :check_license!
before_action do
push_frontend_feature_flag(:enable_geo_design_sync)
end
def index
end
end
......@@ -3,9 +3,6 @@
class Admin::Geo::NodesController < Admin::Geo::ApplicationController
before_action :check_license!, except: :index
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
def index
......
......@@ -7,8 +7,6 @@ module Geo
private
def sync_repository
return if Feature.disabled?(:enable_geo_design_sync)
start_registry_sync!
fetch_repository
mark_sync_as_successful
......
......@@ -16,7 +16,6 @@ module Geo
def execute
return false unless Gitlab::Geo.primary?
return false if design? && Feature.disabled?(:enable_geo_design_sync)
reset_repository_checksum!
create_repository_updated_event!
......
......@@ -22,11 +22,10 @@
= link_to admin_geo_projects_path, title: 'Projects' do
%span
= _('Projects')
- if Feature.enabled?(:enable_geo_design_sync)
= nav_link(path: 'admin/geo/designs#index') do
= link_to admin_geo_designs_path, title: _('Designs') do
%span
= _('Designs')
= nav_link(path: 'admin/geo/designs#index') do
= link_to admin_geo_designs_path, title: _('Designs') do
%span
= _('Designs')
= nav_link(path: 'admin/geo/uploads#index') do
= link_to admin_geo_uploads_path, title: 'Uploads' do
%span
......
......@@ -15,10 +15,7 @@ module Geo
end
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
project = registry.project
if project.nil?
......
---
title: Geo - Replicate project designs repositories
merge_request: 22544
author:
type: added
......@@ -29,10 +29,6 @@ module Gitlab
end
end
def skippable?
Feature.disabled?(:enable_geo_design_sync)
end
def log_event(job_id)
logger.event_info(
created_at,
......
......@@ -339,12 +339,10 @@ namespace :geo do
puts using_percentage(current_node_status.container_repositories_synced_in_percentage)
end
if Feature.enabled?(:enable_geo_design_sync)
print 'Design repositories: '.rjust(GEO_STATUS_COLUMN_WIDTH)
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} "
puts using_percentage(current_node_status.design_repositories_synced_in_percentage)
end
print 'Design repositories: '.rjust(GEO_STATUS_COLUMN_WIDTH)
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} "
puts using_percentage(current_node_status.design_repositories_synced_in_percentage)
if Gitlab::CurrentSettings.repository_checks_enabled
print 'Repositories Checked: '.rjust(GEO_STATUS_COLUMN_WIDTH)
......
......@@ -36,53 +36,31 @@ describe Gitlab::Geo::LogCursor::Events::DesignRepositoryUpdatedEvent, :clean_gi
end
describe '#process' do
context 'when the feature flag is disabled' do
context 'when the associated shard is healthy' do
before do
stub_feature_flags(enable_geo_design_sync: false)
allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(true)
end
it 'does not create a design registry' do
expect { subject.process }.not_to change(Geo::DesignRegistry, :count)
end
it_behaves_like 'DesignRepositoryUpdatedEvent'
it 'does not schedule a Geo::DesignRepositorySyncWorker job' do
expect(Geo::DesignRepositorySyncWorker).not_to receive(:perform_async).with(project.id)
it 'schedules a Geo::DesignRepositorySyncWorker' do
expect(Geo::DesignRepositorySyncWorker).to receive(:perform_async).with(project.id).once
subject.process
end
end
context 'when the feature flag is disabled' do
context 'when associated shard is unhealthy' do
before do
stub_feature_flags(enable_geo_design_sync: true)
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
allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(false)
end
context 'when associated shard is unhealthy' do
before do
allow(Gitlab::ShardHealthCache).to receive(:healthy_shard?).with('default').and_return(false)
end
it_behaves_like 'DesignRepositoryUpdatedEvent'
it_behaves_like 'DesignRepositoryUpdatedEvent'
it 'does not schedule a Geo::DesignRepositorySyncWorker job' do
expect(Geo::DesignRepositorySyncWorker).not_to receive(:perform_async).with(project.id)
it 'does not schedule a Geo::DesignRepositorySyncWorker job' do
expect(Geo::DesignRepositorySyncWorker).not_to receive(:perform_async).with(project.id)
subject.process
end
subject.process
end
end
end
......
......@@ -94,12 +94,6 @@ describe Geo::RepositoryUpdatedService do
it 'creates a design repository updated event' do
expect { subject.execute }.to change(Geo::RepositoryUpdatedEvent, :count).by(1)
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
......@@ -15,16 +15,6 @@ describe Geo::DesignRepositorySyncWorker, :geo do
expect(service).to have_received(:execute)
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
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