Skip to content

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

Merge branch 'dev' into bug/58018-nextcloud-connection-validation-fails-on-disabled-ampf-configuration

Eric Schubert9613fe404b49
diff --cc modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb
index 5c64da713a4,72047520c10..371d24b18cc
--- a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb
@@@ -49,33 -55,19 +49,33 @@@ module Storage
description: nil))
end
- # rubocop:enable Metrics/AbcSize
-
private
+ def has_base_configuration_error?
+ host_url_not_found
+ .or { missing_dependencies }
+ .or { version_mismatch }
+ .or { with_unexpected_content }
+ .or { capabilities_request_failed_with_unknown_error }
+ end
+
+ def has_ampf_configuration_error?
+ return None() unless @storage.automatic_management_enabled?
+
+ userless_access_denied
+ .or { group_folder_not_found }
+ .or { files_request_failed_with_unknown_error }
+ end
+
def capabilities
@capabilities ||= Peripherals::Registry
- .resolve("#{@storage.short_provider_type}.queries.capabilities")
- .resolve("#{@storage}.queries.capabilities")
- .call(storage: @storage, auth_strategy: noop)
++ .resolve("#{@storage}.queries.capabilities")
+ .call(storage: @storage, auth_strategy: noop)
end
def files
@files ||= Peripherals::Registry
-- .resolve("#{@storage.short_provider_type}.queries.files")
++ .resolve("#{@storage}.queries.files")
.call(storage: @storage, auth_strategy: userless, folder: ParentFolder.new(@storage.group_folder))
end
diff --cc modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rb
index f95786a23f0,b34027fbb67..2a72da8c9ef
--- a/modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/nextcloud_connection_validator_spec.rb
@@@ -31,8 -33,8 +33,8 @@@ require_module_spec_helpe
RSpec.describe Storages::Peripherals::NextcloudConnectionValidator do
before do
- Storages::Peripherals::Registry.stub("#{storage.short_provider_type}.queries.capabilities", ->(_) { capabilities_response })
- Storages::Peripherals::Registry.stub("#{storage.short_provider_type}.queries.files", ->(_) { files_response })
+ Storages::Peripherals::Registry.stub("#{storage}.queries.capabilities", ->(_) { capabilities_response })
- Storages::Peripherals::Registry.stub("#{storage.short_provider_type}.queries.files", ->(_) { files_response })
++ Storages::Peripherals::Registry.stub("#{storage}.queries.files", ->(_) { files_response })
end
subject { described_class.new(storage:).validate }