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
[#57068] Nextcloud "recheck connection" checks for GroupFolderApp though AMPF is deactivated
Pavel Balashoudc77722a7f72
diff --git a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rbindex faae38e2758..b5645fa7a4e 100644--- a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb+++ b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb@@ -83,7 +83,7 @@ module Storagescapabilities = query.result- if !capabilities.app_enabled? || !capabilities.group_folder_enabled?+ if !capabilities.app_enabled? || (@storage.automatically_managed? && !capabilities.group_folder_enabled?)app_name = if capabilities.app_enabled?I18n.t("storages.dependencies.nextcloud.group_folders_app")else@@ -114,28 +114,26 @@ module Storagesmin_group_folder_version = SemanticVersion.parse(config.dig("dependencies", "group_folders_app", "min_version"))capabilities = query.result- fetched_app_version = capabilities.app_version- fetched_group_folder_version = capabilities.group_folder_version- if fetched_app_version < min_app_version+ if capabilities.app_version < min_app_versionSome(ConnectionValidation.new(type: :error,error_code: :err_unexpected_version,timestamp: Time.current,description: I18n.t("storages.health.connection_validation.app_version_mismatch",- found: fetched_app_version.to_s,+ found: capabilities.app_version.to_s,expected: min_app_version.to_s)))- elsif fetched_group_folder_version < min_group_folder_version+ elsif @storage.automatically_managed? && capabilities.group_folder_version < min_group_folder_versionSome(ConnectionValidation.new(type: :error,error_code: :err_unexpected_version,timestamp: Time.current,description: I18n.t("storages.health.connection_validation.group_folder_version_mismatch",- found: fetched_group_folder_version.to_s,+ found: capabilities.group_folder_version.to_s,expected: min_group_folder_version.to_s)))diff --git a/modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rbindex 3a0109f4a59..1ab254fd0ed 100644--- a/modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rb@@ -59,7 +59,7 @@ RSpec.describe Storages::Peripherals::NextcloudConnectionValidator doendcontext "if request returns a capabilities response" do- let(:storage) { create(:nextcloud_storage_configured) }+ let(:storage) { create(:nextcloud_storage_configured, :as_automatically_managed) }let(:app_enabled) { true }let(:app_version) { Storages::SemanticVersion.parse("2.6.3") }let(:group_folder_enabled) { true }@@ -110,6 +110,15 @@ RSpec.describe Storages::Peripherals::NextcloudConnectionValidator doexpect(subject.description).to eq("A required dependency is missing on the file storage. " \"Please add the following dependency: Group folders.")end++ context "if storage is not automatically_managed" do+ let(:storage) { create(:nextcloud_storage_configured) }++ it "does not check group_folder app" do+ expect(subject.type).to eq(:healthy)+ expect(subject.error_code).to eq(:none)+ end+ endendcontext "with outdated group folder app" do@@ -121,6 +130,15 @@ RSpec.describe Storages::Peripherals::NextcloudConnectionValidator doexpect(subject.description).to eq("The Group Folder version is not supported. Please update your Nextcloud server.")end++ context "if storage is not automatically_managed" do+ let(:storage) { create(:nextcloud_storage_configured) }++ it "does not check group_folder app" do+ expect(subject.type).to eq(:healthy)+ expect(subject.error_code).to eq(:none)+ end+ endendendend