diff --git a/.rubocop_todo/gitlab/no_find_in_workers.yml b/.rubocop_todo/gitlab/no_find_in_workers.yml index bb9c2f2dcb69d9491c10b4806d543bec43b3fa32..d407df5da09b96cf19da380f281312e2c6665263 100644 --- a/.rubocop_todo/gitlab/no_find_in_workers.yml +++ b/.rubocop_todo/gitlab/no_find_in_workers.yml @@ -45,7 +45,6 @@ Gitlab/NoFindInWorkers: - 'app/workers/merge_worker.rb' - 'app/workers/namespaces/root_statistics_worker.rb' - 'app/workers/namespaces/schedule_aggregation_worker.rb' - - 'app/workers/onboarding/user_added_worker.rb' - 'app/workers/packages/go/sync_packages_worker.rb' - 'app/workers/packages/npm/deprecate_package_worker.rb' - 'app/workers/project_destroy_worker.rb' diff --git a/.rubocop_todo/rspec/named_subject.yml b/.rubocop_todo/rspec/named_subject.yml index 8be74f9c046711ea302a4f51d2d0af1f056baccf..3d446b3aeb4e99b08a6dfdddd40ac0e76ce74440 100644 --- a/.rubocop_todo/rspec/named_subject.yml +++ b/.rubocop_todo/rspec/named_subject.yml @@ -3506,7 +3506,6 @@ RSpec/NamedSubject: - 'spec/workers/object_pool/destroy_worker_spec.rb' - 'spec/workers/object_pool/join_worker_spec.rb' - 'spec/workers/object_storage/delete_stale_direct_uploads_worker_spec.rb' - - 'spec/workers/onboarding/issue_created_worker_spec.rb' - 'spec/workers/packages/cleanup/delete_orphaned_dependencies_worker_spec.rb' - 'spec/workers/packages/cleanup_package_file_worker_spec.rb' - 'spec/workers/packages/debian/cleanup_dangling_package_files_worker_spec.rb' diff --git a/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml b/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml index f4512c123f7069d89626c0e83830c89d9a870e47..41533e842ff881698dfd92542cf9bf85ecf7bd8f 100644 --- a/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml +++ b/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml @@ -178,10 +178,6 @@ SidekiqLoadBalancing/WorkerDataConsistency: - 'app/workers/object_pool/join_worker.rb' - 'app/workers/object_pool/schedule_join_worker.rb' - 'app/workers/object_storage/migrate_uploads_worker.rb' - - 'app/workers/onboarding/issue_created_worker.rb' - - 'app/workers/onboarding/pipeline_created_worker.rb' - - 'app/workers/onboarding/progress_worker.rb' - - 'app/workers/onboarding/user_added_worker.rb' - 'app/workers/packages/cleanup/execute_policy_worker.rb' - 'app/workers/packages/cleanup_package_file_worker.rb' - 'app/workers/packages/cleanup_package_registry_worker.rb' diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 44be95d7c62a037a329cbd6c71044a9439a60861..f42a991b82b8c4ee20bc3ac6d3cdb97b3ed7992b 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -3711,42 +3711,6 @@ :weight: 2 :idempotent: false :tags: [] -- :name: onboarding_issue_created - :worker_name: Onboarding::IssueCreatedWorker - :feature_category: :onboarding - :has_external_dependencies: false - :urgency: :low - :resource_boundary: :unknown - :weight: 1 - :idempotent: true - :tags: [] -- :name: onboarding_pipeline_created - :worker_name: Onboarding::PipelineCreatedWorker - :feature_category: :onboarding - :has_external_dependencies: false - :urgency: :low - :resource_boundary: :unknown - :weight: 1 - :idempotent: true - :tags: [] -- :name: onboarding_progress - :worker_name: Onboarding::ProgressWorker - :feature_category: :onboarding - :has_external_dependencies: false - :urgency: :low - :resource_boundary: :cpu - :weight: 1 - :idempotent: true - :tags: [] -- :name: onboarding_user_added - :worker_name: Onboarding::UserAddedWorker - :feature_category: :onboarding - :has_external_dependencies: false - :urgency: :low - :resource_boundary: :unknown - :weight: 1 - :idempotent: true - :tags: [] - :name: pages :worker_name: PagesWorker :feature_category: :pages diff --git a/app/workers/onboarding/issue_created_worker.rb b/app/workers/onboarding/issue_created_worker.rb deleted file mode 100644 index 970e586ac29e22c13d750dfc325d633d61591219..0000000000000000000000000000000000000000 --- a/app/workers/onboarding/issue_created_worker.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Onboarding - class IssueCreatedWorker - include ApplicationWorker - - data_consistency :always - - sidekiq_options retry: 3 - - feature_category :onboarding - urgency :low - - deduplicate :until_executing - idempotent! - - def perform(_namespace_id) - # Deprecating per guide: https://docs.gitlab.com/ee/development/sidekiq/compatibility_across_updates.html#removing-worker-classes - # TODO: cleanup in https://gitlab.com/gitlab-org/gitlab/-/issues/472664 - end - end -end diff --git a/app/workers/onboarding/pipeline_created_worker.rb b/app/workers/onboarding/pipeline_created_worker.rb deleted file mode 100644 index c9c411dcb7b648e7da00459c0cf67682580825ab..0000000000000000000000000000000000000000 --- a/app/workers/onboarding/pipeline_created_worker.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Onboarding - class PipelineCreatedWorker - include ApplicationWorker - - data_consistency :always - - sidekiq_options retry: 3 - - feature_category :onboarding - urgency :low - - deduplicate :until_executing - idempotent! - - def perform(_namespace_id) - # Deprecating per guide: https://docs.gitlab.com/ee/development/sidekiq/compatibility_across_updates.html#removing-worker-classes - # TODO: cleanup in https://gitlab.com/gitlab-org/gitlab/-/issues/472664 - end - end -end diff --git a/app/workers/onboarding/progress_worker.rb b/app/workers/onboarding/progress_worker.rb deleted file mode 100644 index 8fd7732069f92a5440dea9b966d07f102a0b450c..0000000000000000000000000000000000000000 --- a/app/workers/onboarding/progress_worker.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module Onboarding - class ProgressWorker - include ApplicationWorker - - data_consistency :always - - sidekiq_options retry: 3 - - feature_category :onboarding - worker_resource_boundary :cpu - urgency :low - - deduplicate :until_executed - idempotent! - - def perform(_namespace_id, _action) - # Deprecating per guide: https://docs.gitlab.com/ee/development/sidekiq/compatibility_across_updates.html#removing-worker-classes - # TODO: remove in https://gitlab.com/gitlab-org/gitlab/-/issues/472664 - end - end -end diff --git a/app/workers/onboarding/user_added_worker.rb b/app/workers/onboarding/user_added_worker.rb deleted file mode 100644 index de0a5139366cc3d406b5499de2214bb9f755c601..0000000000000000000000000000000000000000 --- a/app/workers/onboarding/user_added_worker.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -module Onboarding - class UserAddedWorker - include ApplicationWorker - - data_consistency :always - - sidekiq_options retry: 3 - - feature_category :onboarding - urgency :low - - idempotent! - - def perform(_namespace_id) - # Deprecating per guide: https://docs.gitlab.com/ee/development/sidekiq/compatibility_across_updates.html#removing-worker-classes - # TODO: cleanup in https://gitlab.com/gitlab-org/gitlab/-/issues/472664 - end - end -end diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index a9d25a0a67906f1cd92c00d3b05a1ddb3f98c221..11eda113650f0a1c3ba2313a709da4184386e5ea 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -579,16 +579,8 @@ - 1 - - onboarding_create_iterable_triggers - 1 -- - onboarding_issue_created - - 1 -- - onboarding_pipeline_created - - 1 -- - onboarding_progress - - 1 - - onboarding_progress_tracking - 1 -- - onboarding_user_added - - 1 - - package_cleanup - 1 - - package_metadata_global_advisory_scan diff --git a/db/migrate/20240925170312_remove_legacy_onboarding_workers_job_instances.rb b/db/migrate/20240925170312_remove_legacy_onboarding_workers_job_instances.rb new file mode 100644 index 0000000000000000000000000000000000000000..3e4723dbf223995b0a48c297758fe6f068b523e6 --- /dev/null +++ b/db/migrate/20240925170312_remove_legacy_onboarding_workers_job_instances.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class RemoveLegacyOnboardingWorkersJobInstances < Gitlab::Database::Migration[2.2] + milestone '17.5' + + disable_ddl_transaction! + + DEPRECATED_JOB_CLASSES = %w[ + Onboarding::IssueCreatedWorker + Onboarding::PipelineCreatedWorker + Onboarding::ProgressWorker + Onboarding::UserAddedWorker + ].freeze + + def up + # Removes scheduled instances from Sidekiq queues + sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) + end + + def down + # This migration removes any instances of deprecated workers and cannot be undone. + end +end diff --git a/db/schema_migrations/20240925170312 b/db/schema_migrations/20240925170312 new file mode 100644 index 0000000000000000000000000000000000000000..b2f43627004ce67b7a166322d19c1d0ba148c38c --- /dev/null +++ b/db/schema_migrations/20240925170312 @@ -0,0 +1 @@ +e619452bb9fa4e26a9082faf139fa625065b1eecc1751daf100ee248c9522948 \ No newline at end of file diff --git a/ee/spec/services/epics/create_service_spec.rb b/ee/spec/services/epics/create_service_spec.rb index 7a1447aecb4a66e4251113ce7146557e713564e3..b89194e25a38b9d8698a89ff960a5ef75c4a78e1 100644 --- a/ee/spec/services/epics/create_service_spec.rb +++ b/ee/spec/services/epics/create_service_spec.rb @@ -149,7 +149,6 @@ it 'does not call after commit workers for the work item' do expect(NewIssueWorker).not_to receive(:perform_async) expect(Issues::PlacementWorker).not_to receive(:perform_async) - expect(Onboarding::IssueCreatedWorker).not_to receive(:perform_async) subject end diff --git a/spec/workers/every_sidekiq_worker_spec.rb b/spec/workers/every_sidekiq_worker_spec.rb index c347b51482af945bfa64b1fa062f6666dee35d06..95da2982e70c7f12fccd4fc6c19346645b25cb0f 100644 --- a/spec/workers/every_sidekiq_worker_spec.rb +++ b/spec/workers/every_sidekiq_worker_spec.rb @@ -365,11 +365,7 @@ 'MergeTrains::RefreshWorker' => 3, 'MergeWorker' => 3, 'MigrateExternalDiffsWorker' => 3, - 'Onboarding::IssueCreatedWorker' => 3, - 'Onboarding::PipelineCreatedWorker' => 3, - 'Onboarding::ProgressWorker' => 3, 'Onboarding::ProgressTrackingWorker' => 3, - 'Onboarding::UserAddedWorker' => 3, 'Namespaces::RootStatisticsWorker' => 3, 'Namespaces::ScheduleAggregationWorker' => 3, 'NewEpicWorker' => 3, diff --git a/spec/workers/onboarding/issue_created_worker_spec.rb b/spec/workers/onboarding/issue_created_worker_spec.rb deleted file mode 100644 index d9f36abaf2a79c65b3da112ad85246ab5989357e..0000000000000000000000000000000000000000 --- a/spec/workers/onboarding/issue_created_worker_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Onboarding::IssueCreatedWorker, '#perform', feature_category: :onboarding do - specify do - expect { described_class.new.perform(non_existing_record_id) }.not_to raise_error - end -end diff --git a/spec/workers/onboarding/pipeline_created_worker_spec.rb b/spec/workers/onboarding/pipeline_created_worker_spec.rb deleted file mode 100644 index 63be5a0d5278f1596e7bc11bfd8deff07bdc4c14..0000000000000000000000000000000000000000 --- a/spec/workers/onboarding/pipeline_created_worker_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Onboarding::PipelineCreatedWorker, '#perform', feature_category: :onboarding do - specify do - expect { described_class.new.perform(non_existing_record_id) }.not_to raise_error - end -end diff --git a/spec/workers/onboarding/progress_worker_spec.rb b/spec/workers/onboarding/progress_worker_spec.rb deleted file mode 100644 index 19c1d629b72f3236de625a2e31285a770dbf23c1..0000000000000000000000000000000000000000 --- a/spec/workers/onboarding/progress_worker_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Onboarding::ProgressWorker, '#perform', feature_category: :onboarding do - specify do - expect { described_class.new.perform(non_existing_record_id, '_action_') }.not_to raise_error - end -end diff --git a/spec/workers/onboarding/user_added_worker_spec.rb b/spec/workers/onboarding/user_added_worker_spec.rb deleted file mode 100644 index d717c87da55459744cac1b08d7da239c6cf0d8d1..0000000000000000000000000000000000000000 --- a/spec/workers/onboarding/user_added_worker_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Onboarding::UserAddedWorker, '#perform', feature_category: :onboarding do - specify do - expect { described_class.new.perform(non_existing_record_id) }.not_to raise_error - end -end