From 776027ca61a8c170ce91c5d8f8c438ecd33c42f9 Mon Sep 17 00:00:00 2001
From: Vasilii Iakliushin <viakliushin@gitlab.com>
Date: Wed, 22 Feb 2023 17:55:34 +0100
Subject: [PATCH] Cleanup add_refresh_pull_mirror_worker feature flag

Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/391934

**Problem**

After user downgrades their payment plan to Free, then the pull
mirroring configuration is disabled. It's not re-enabled after user
upgrades back and it requires extra efforts to enable it for each
project.

**Solution**

Automatically re-enable pull mirroring configurations after the
subscription upgrade.

Changelog: added
---
 .../development/add_refresh_pull_mirror_worker.yml   |  8 --------
 .../pull_mirrors/reenable_configuration_worker.rb    |  1 -
 .../reenable_configuration_worker_spec.rb            | 12 ------------
 3 files changed, 21 deletions(-)
 delete mode 100644 config/feature_flags/development/add_refresh_pull_mirror_worker.yml

diff --git a/config/feature_flags/development/add_refresh_pull_mirror_worker.yml b/config/feature_flags/development/add_refresh_pull_mirror_worker.yml
deleted file mode 100644
index f59f0ff3d8e64..0000000000000
--- a/config/feature_flags/development/add_refresh_pull_mirror_worker.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: add_refresh_pull_mirror_worker
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103665
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/382226
-milestone: '15.7'
-type: development
-group: group::source code
-default_enabled: false
diff --git a/ee/app/workers/pull_mirrors/reenable_configuration_worker.rb b/ee/app/workers/pull_mirrors/reenable_configuration_worker.rb
index 58d57f2b0bec2..bdc297dcc14f2 100644
--- a/ee/app/workers/pull_mirrors/reenable_configuration_worker.rb
+++ b/ee/app/workers/pull_mirrors/reenable_configuration_worker.rb
@@ -14,7 +14,6 @@ def handle_event(event)
       namespace = Namespace.find_by_id(event.data[:namespace_id])
 
       return if namespace.blank?
-      return if Feature.disabled?(:add_refresh_pull_mirror_worker, namespace)
 
       cte = Gitlab::SQL::CTE.new(:namespace_ids, namespace.self_and_descendant_ids)
 
diff --git a/ee/spec/workers/pull_mirrors/reenable_configuration_worker_spec.rb b/ee/spec/workers/pull_mirrors/reenable_configuration_worker_spec.rb
index c46e1a8d5092d..b7955eefa0607 100644
--- a/ee/spec/workers/pull_mirrors/reenable_configuration_worker_spec.rb
+++ b/ee/spec/workers/pull_mirrors/reenable_configuration_worker_spec.rb
@@ -27,18 +27,6 @@
       .and not_change { another_namespace_mirror_state.reload.retry_count }
   end
 
-  context 'when feature flag add_refresh_pull_mirror_worker is disabled' do
-    before do
-      stub_feature_flags(add_refresh_pull_mirror_worker: false)
-    end
-
-    it 'does not re-enable pull mirror configurations' do
-      expect do
-        consume_event(subscriber: described_class, event: subscription_started_event)
-      end.not_to change { mirror_state.reload.retry_count }
-    end
-  end
-
   context 'when namespace id is missing' do
     let(:data) { { namespace_id: non_existing_record_id } }
 
-- 
GitLab