Commit 815d5d5b authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch 'elastic-migration-worker-feature-flag' into 'master'

Add feature flag toggle for elastic migration worker

See merge request gitlab-org/gitlab!80310
parents cf7691db b3c1a789
---
name: elastic_migration_worker
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80310
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/352424
milestone: '14.8'
type: ops
group: group::global search
default_enabled: true
...@@ -17,6 +17,7 @@ module Elastic ...@@ -17,6 +17,7 @@ module Elastic
urgency :throttled urgency :throttled
def perform def perform
return false if Feature.disabled?(:elastic_migration_worker, type: :ops, default_enabled: :yaml)
return false unless Gitlab::CurrentSettings.elasticsearch_indexing? return false unless Gitlab::CurrentSettings.elasticsearch_indexing?
return false unless helper.alias_exists? return false unless helper.alias_exists?
......
...@@ -6,6 +6,18 @@ RSpec.describe Elastic::MigrationWorker, :elastic do ...@@ -6,6 +6,18 @@ RSpec.describe Elastic::MigrationWorker, :elastic do
subject { described_class.new } subject { described_class.new }
describe '#perform' do describe '#perform' do
context 'Feature Flag `elastic_migration_worker` is disabled' do
before do
stub_feature_flags(elastic_migration_worker: false)
stub_ee_application_setting(elasticsearch_indexing: true)
end
it 'returns with no execution' do
expect(subject).not_to receive(:execute_migration)
expect(subject.perform).to be_falsey
end
end
context 'indexing is disabled' do context 'indexing is disabled' do
before do before do
stub_ee_application_setting(elasticsearch_indexing: false) stub_ee_application_setting(elasticsearch_indexing: false)
......
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