OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#55112] Rename Storages::ManageNextcloudIntegrationJob
Pavel Balashou6363263153a1
diff --git a/lib/tasks/cron.rake b/lib/tasks/cron.rakeindex c821efa35c3..15fa97459ea 100644--- a/lib/tasks/cron.rake+++ b/lib/tasks/cron.rake@@ -29,6 +29,6 @@namespace "openproject:cron" dodesc "Ensure the cron-like background jobs are properly unscheduled if needed"task schedule: [:environment] do- Storages::ManageNextcloudIntegrationJob.disable_cron_job_if_needed+ Storages::ManageStorageIntegrationsJob.disable_cron_job_if_neededendenddiff --git a/modules/storages/app/workers/storages/manage_nextcloud_integration_job.rb b/modules/storages/app/workers/storages/manage_storage_integrations_job.rbsimilarity index 95%rename from modules/storages/app/workers/storages/manage_nextcloud_integration_job.rbrename to modules/storages/app/workers/storages/manage_storage_integrations_job.rbindex 3ae88df231c..d753e791152 100644--- a/modules/storages/app/workers/storages/manage_nextcloud_integration_job.rb+++ b/modules/storages/app/workers/storages/manage_storage_integrations_job.rb@@ -27,7 +27,7 @@#++module Storages- class ManageNextcloudIntegrationJob < ApplicationJob+ class ManageStorageIntegrationsJob < ApplicationJobinclude GoodJob::ActiveJobExtensions::Concurrencyusing ::Storages::Peripherals::ServiceResultRefinements@@ -44,12 +44,11 @@ module Storagesgood_job_control_concurrency_with(total_limit: 2,enqueue_limit: 1,- perform_limit: 1,- key: "ManageNextcloudIntegrationJob"+ perform_limit: 1)SINGLE_THREAD_DEBOUNCE_TIME = 4.seconds.freezeKEY = :manage_nextcloud_integration_job_debounce_happened_at- CRON_JOB_KEY = :"Storages::ManageNextcloudIntegrationJob"+ CRON_JOB_KEY = :"Storages::ManageStorageIntegrationsJob"queue_with_priority :above_normaldiff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rbindex 49e1121842c..489da74187a 100644--- a/modules/storages/lib/open_project/storages/engine.rb+++ b/modules/storages/lib/open_project/storages/engine.rb@@ -62,7 +62,7 @@ module OpenProject::StoragesOpenProject::Events::PROJECT_UNARCHIVED].each do |event|OpenProject::Notifications.subscribe(event) do |_payload|- ::Storages::ManageNextcloudIntegrationJob.debounce+ ::Storages::ManageStorageIntegrationsJob.debounceendend@@ -70,7 +70,7 @@ module OpenProject::StoragesOpenProject::Events::OAUTH_CLIENT_TOKEN_CREATED) do |payload|if payload[:integration_type] == "Storages::Storage"- ::Storages::ManageNextcloudIntegrationJob.debounce+ ::Storages::ManageStorageIntegrationsJob.debounceendend@@ -78,7 +78,7 @@ module OpenProject::StoragesOpenProject::Events::ROLE_UPDATED) do |payload|if payload[:permissions_diff]&.intersect?(OpenProject::Storages::Engine.permissions)- ::Storages::ManageNextcloudIntegrationJob.debounce+ ::Storages::ManageStorageIntegrationsJob.debounceendend@@ -86,7 +86,7 @@ module OpenProject::StoragesOpenProject::Events::ROLE_DESTROYED) do |payload|if payload[:permissions]&.intersect?(OpenProject::Storages::Engine.permissions)- ::Storages::ManageNextcloudIntegrationJob.debounce+ ::Storages::ManageStorageIntegrationsJob.debounceendend@@ -97,8 +97,8 @@ module OpenProject::Storages].each do |event|OpenProject::Notifications.subscribe(event) do |payload|if payload[:project_folder_mode] == :automatic- ::Storages::ManageNextcloudIntegrationJob.debounce- ::Storages::ManageNextcloudIntegrationJob.disable_cron_job_if_needed+ ::Storages::ManageStorageIntegrationsJob.debounce+ ::Storages::ManageStorageIntegrationsJob.disable_cron_job_if_neededendendend@@ -331,9 +331,9 @@ module OpenProject::Storagesclass: ::Storages::CleanupUncontaineredFileLinksJob.name},- "Storages::ManageNextcloudIntegrationJob": {+ "Storages::ManageStorageIntegrationsJob": {cron: "1 * * * *", # every hour at xx:01- class: ::Storages::ManageNextcloudIntegrationJob.name+ class: ::Storages::ManageStorageIntegrationsJob.name}}enddiff --git a/modules/storages/spec/workers/storages/manage_nextcloud_integration_job_spec.rb b/modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rbsimilarity index 96%rename from modules/storages/spec/workers/storages/manage_nextcloud_integration_job_spec.rbrename to modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rbindex aecea8f61d3..cb46183921d 100644--- a/modules/storages/spec/workers/storages/manage_nextcloud_integration_job_spec.rb+++ b/modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rb@@ -31,7 +31,7 @@require "spec_helper"require_module_spec_helper-RSpec.describe Storages::ManageNextcloudIntegrationJob, :webmock, type: :job do+RSpec.describe Storages::ManageStorageIntegrationsJob, :webmock, type: :job dodescribe ".debounce" docontext "when has been debounced by other thread" dobefore { ActiveJob::Base.disable_test_adapter }@@ -76,7 +76,7 @@ RSpec.describe Storages::ManageNextcloudIntegrationJob, :webmock, type: :job dogood_job_setting = GoodJob::Setting.firstexpect(good_job_setting.key).to eq("cron_keys_disabled")- expect(good_job_setting.value).to eq(["Storages::ManageNextcloudIntegrationJob"])+ expect(good_job_setting.value).to eq(["Storages::ManageStorageIntegrationsJob"])expect { subject }.not_to change(GoodJob::Setting, :count).from(1)@@ -100,7 +100,7 @@ RSpec.describe Storages::ManageNextcloudIntegrationJob, :webmock, type: :job dogood_job_setting = GoodJob::Setting.firstexpect(good_job_setting.key).to eq("cron_keys_disabled")- expect(good_job_setting.value).to eq(["Storages::ManageNextcloudIntegrationJob"])+ expect(good_job_setting.value).to eq(["Storages::ManageStorageIntegrationsJob"])endendenddiff --git a/spec/controllers/roles_controller_spec.rb b/spec/controllers/roles_controller_spec.rbindex ef52683f50d..031a694741d 100644--- a/spec/controllers/roles_controller_spec.rb+++ b/spec/controllers/roles_controller_spec.rb@@ -387,7 +387,7 @@ RSpec.describe RolesController dosubjectexpect(enqueued_jobs.count).to eq(1)- expect(enqueued_jobs[0][:job]).to eq(Storages::ManageNextcloudIntegrationJob)+ expect(enqueued_jobs[0][:job]).to eq(Storages::ManageStorageIntegrationsJob)expect(response).to redirect_to roles_pathexpect(Role.count).to eq(0)enddiff --git a/spec/lib/open_project/events_spec.rb b/spec/lib/open_project/events_spec.rbindex 14d968e6e06..da7d20b7251 100644--- a/spec/lib/open_project/events_spec.rb+++ b/spec/lib/open_project/events_spec.rb@@ -37,7 +37,7 @@ RSpec.describe OpenProject::Events doendbefore do- allow(Storages::ManageNextcloudIntegrationJob).to receive(:debounce)+ allow(Storages::ManageStorageIntegrationsJob).to receive(:debounce)end%w[@@ -53,7 +53,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).not_to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).not_to have_received(:debounce)endend@@ -62,13 +62,13 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).to have_received(:debounce)endit do- allow(Storages::ManageNextcloudIntegrationJob).to receive(:disable_cron_job_if_needed)+ allow(Storages::ManageStorageIntegrationsJob).to receive(:disable_cron_job_if_needed)subject- expect(Storages::ManageNextcloudIntegrationJob).to have_received(:disable_cron_job_if_needed)+ expect(Storages::ManageStorageIntegrationsJob).to have_received(:disable_cron_job_if_needed)endendend@@ -90,7 +90,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).to have_received(:debounce)endendend@@ -103,7 +103,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).not_to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).not_to have_received(:debounce)endend@@ -112,7 +112,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).to have_received(:debounce)endendend@@ -125,7 +125,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).not_to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).not_to have_received(:debounce)endend@@ -134,7 +134,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).to have_received(:debounce)endendend@@ -147,7 +147,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).not_to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).not_to have_received(:debounce)endend@@ -156,7 +156,7 @@ RSpec.describe OpenProject::Events doit dosubject- expect(Storages::ManageNextcloudIntegrationJob).to have_received(:debounce)+ expect(Storages::ManageStorageIntegrationsJob).to have_received(:debounce)endendend