From e4f0c2807095e2051c7f70bd27fea556cf715f55 Mon Sep 17 00:00:00 2001
From: Peter Leitzen <pleitzen@gitlab.com>
Date: Tue, 22 Oct 2024 18:12:11 +0200
Subject: [PATCH] Move suggested reviewers secret setup to EE config
 initializers

---
 .rubocop_todo/gitlab/avoid_gitlab_instance_checks.yml           | 2 +-
 .../config}/initializers/gitlab_suggested_reviewers_secret.rb   | 2 +-
 ee/spec/initializers/gitlab_suggested_reviewers_secret_spec.rb  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename {config => ee/config}/initializers/gitlab_suggested_reviewers_secret.rb (68%)

diff --git a/.rubocop_todo/gitlab/avoid_gitlab_instance_checks.yml b/.rubocop_todo/gitlab/avoid_gitlab_instance_checks.yml
index aabf72cd284c5..542e3c700a019 100644
--- a/.rubocop_todo/gitlab/avoid_gitlab_instance_checks.yml
+++ b/.rubocop_todo/gitlab/avoid_gitlab_instance_checks.yml
@@ -27,7 +27,6 @@ Gitlab/AvoidGitlabInstanceChecks:
     - 'config/initializers/active_record_transaction_observer.rb'
     - 'config/initializers/active_record_transaction_patches.rb'
     - 'config/initializers/check_forced_decomposition.rb'
-    - 'config/initializers/gitlab_suggested_reviewers_secret.rb'
     - 'config/initializers/rack_multipart_patch.rb'
     - 'config/initializers/validate_puma.rb'
     - 'config/initializers/warden.rb'
@@ -77,6 +76,7 @@ Gitlab/AvoidGitlabInstanceChecks:
     - 'ee/app/workers/gitlab_subscriptions/refresh_seats_worker.rb'
     - 'ee/app/workers/gitlab_subscriptions/schedule_refresh_seats_worker.rb'
     - 'ee/app/workers/update_all_mirrors_worker.rb'
+    - 'ee/config/initializers/gitlab_suggested_reviewers_secret.rb'
     - 'ee/lib/api/code_suggestions.rb'
     - 'ee/lib/api/scim/instance_scim.rb'
     - 'ee/lib/ee/api/namespaces.rb'
diff --git a/config/initializers/gitlab_suggested_reviewers_secret.rb b/ee/config/initializers/gitlab_suggested_reviewers_secret.rb
similarity index 68%
rename from config/initializers/gitlab_suggested_reviewers_secret.rb
rename to ee/config/initializers/gitlab_suggested_reviewers_secret.rb
index 01c7299c414e8..e71a0e9e49a2d 100644
--- a/config/initializers/gitlab_suggested_reviewers_secret.rb
+++ b/ee/config/initializers/gitlab_suggested_reviewers_secret.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
-return unless Gitlab.com? && Gitlab.ee?
+return unless Gitlab.com?
 
 Gitlab::AppliedMl::SuggestedReviewers.ensure_secret!
diff --git a/ee/spec/initializers/gitlab_suggested_reviewers_secret_spec.rb b/ee/spec/initializers/gitlab_suggested_reviewers_secret_spec.rb
index 65daaff2678a2..2bac226e8ff8d 100644
--- a/ee/spec/initializers/gitlab_suggested_reviewers_secret_spec.rb
+++ b/ee/spec/initializers/gitlab_suggested_reviewers_secret_spec.rb
@@ -6,7 +6,7 @@
   subject { Gitlab::Application.config }
 
   let(:load_suggested_reviewers_secret) do
-    load Rails.root.join('config/initializers/gitlab_suggested_reviewers_secret.rb')
+    load Rails.root.join('ee/config/initializers/gitlab_suggested_reviewers_secret.rb')
   end
 
   context 'when not SAAS' do
-- 
GitLab