# HG changeset patch
# User Gregorius Marco <gmarco@gitlab.com>
# Date 1675413029 -28800
#      Fri Feb 03 16:30:29 2023 +0800
# Node ID a359bb985d502c49bcedbe1a20bf825f81529aa5
# Parent  792f6188f50c347c0ee3b29abc2b8daa9f068015
Deprecate queue_selector and negate options

We are deprecating configuring Sidekiq with queue_selector in favor of
default routing rules. For more info:
https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/596

Changelog: deprecated

diff --git a/files/gitlab-config-template/gitlab.rb.template b/files/gitlab-config-template/gitlab.rb.template
--- a/files/gitlab-config-template/gitlab.rb.template
+++ b/files/gitlab-config-template/gitlab.rb.template
@@ -1059,7 +1059,6 @@
 # sidekiq['log_directory'] = "/var/log/gitlab/sidekiq"
 # sidekiq['log_format'] = "json"
 # sidekiq['shutdown_timeout'] = 4
-# sidekiq['queue_selector'] = false
 # sidekiq['interval'] = nil
 # sidekiq['max_concurrency'] = 20
 # sidekiq['min_concurrency'] = nil
@@ -1076,11 +1075,6 @@
 
 # sidekiq['queue_groups'] = ['*']
 
-##! If negate is enabled then Sidekiq will process all the queues that
-##! don't match those in queue_groups.
-
-# sidekiq['negate'] = false
-
 ##! Specifies where Prometheus metrics endpoints should be made available for Sidekiq processes.
 # sidekiq['metrics_enabled'] = true
 # sidekiq['exporter_log_enabled'] = false
diff --git a/files/gitlab-cookbooks/package/libraries/deprecations.rb b/files/gitlab-cookbooks/package/libraries/deprecations.rb
--- a/files/gitlab-cookbooks/package/libraries/deprecations.rb
+++ b/files/gitlab-cookbooks/package/libraries/deprecations.rb
@@ -330,6 +330,18 @@
             deprecation: '15.5',
             removal: '16.0',
             note: "Starting with GitLab 15.5, this setting cannot be controlled via the configuration file anymore. Follow the steps at https://docs.gitlab.com/ee/user/admin_area/settings/account_and_limit_settings.html#prevent-users-from-creating-top-level-groups, to configure this setting via the Admin UI or the API"
+          },
+          {
+            config_keys: %w(gitlab sidekiq queue_selector),
+            deprecation: '15.9',
+            removal: '17.0',
+            note: "Starting with GitLab 17.0, running Sidekiq with queue selector (`sidekiq['queue_selector'] = true`) will be removed. We recommend to follow the steps at https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html#start-multiple-processes, to run Sidekiq with multiple processes while listening to all queues."
+          },
+          {
+            config_keys: %w(gitlab sidekiq negate),
+            deprecation: '15.9',
+            removal: '17.0',
+            note: "Starting with GitLab 17.0, running Sidekiq with negate (`sidekiq['negate'] = true`) will be removed. We recommend to follow the steps at https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html#start-multiple-processes, to run Sidekiq with multiple processes while listening to all queues."
           }
         ]