From 0aac18fce0ffd05c4b0f5d6874264212373cc2fb Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Mon, 16 Sep 2024 00:25:52 +0200 Subject: [PATCH 1/8] Replace short_provider_type with implicit to_s --- .../nextcloud_connection_validator.rb | 2 +- .../one_drive_connection_validator.rb | 4 ++-- .../storage_interaction/authentication.rb | 2 +- .../oauth_client_form_component.html.erb | 2 +- .../forms/oauth_client_form_component.rb | 4 ++-- .../oauth_client_info_component.html.erb | 2 +- .../admin/oauth_client_info_component.rb | 4 ++-- .../admin/storage_row_component.html.erb | 2 +- .../admin/storage_view_information.rb | 6 ++--- ...auth_access_grant_nudge_modal_component.rb | 2 +- .../storages/project_storages_controller.rb | 4 +++- .../application_password_input.rb | 4 +++- .../forms/storages/admin/oauth_client_form.rb | 6 +++-- .../app/models/storages/project_storage.rb | 6 ++--- .../oauth_applications/create_service.rb | 4 +++- .../copy_project_folders_service.rb | 2 +- .../storages/storage_files_service.rb | 24 +++++++++++++++++++ .../storages/storages/update_service.rb | 6 +++-- .../services/storages/upload_link_service.rb | 4 ++-- .../storages/admin/storages/_new.html.erb | 2 +- .../storages/admin/storages/new.html.erb | 6 ++--- .../admin/storages/update.turbo_stream.erb | 2 +- .../_storage_select_form.html.erb | 2 +- .../_health_status_notification.html.erb | 2 +- .../storages_mailer/notify_healthy.text.erb | 2 +- .../storages_mailer/notify_unhealthy.text.erb | 2 +- .../automatically_managed_storage_sync_job.rb | 2 +- .../api/v3/storage_files/storage_files_api.rb | 12 ++++------ .../lib/api/v3/storages/storage_open_api.rb | 4 +++- .../nextcloud_connection_validator_spec.rb | 4 +++- .../one_drive_connection_validator_spec.rb | 4 +++- .../spec/features/create_file_links_spec.rb | 2 +- .../features/manage_project_storage_spec.rb | 2 +- .../spec/features/show_file_links_spec.rb | 2 +- .../storages_representer_rendering_spec.rb | 2 +- .../oauth_applications/create_service_spec.rb | 2 +- .../project_storages/delete_service_spec.rb | 2 +- .../create_folder_command_examples.rb | 2 +- .../file_info_query_examples.rb | 2 +- .../file_path_to_id_map_query_examples.rb | 2 +- .../files_query_examples.rb | 2 +- .../rename_file_command_examples.rb | 2 +- .../set_permissions_command_examples.rb | 2 +- .../upload_link_query_examples.rb | 2 +- .../storages/copy_project_folders_job_spec.rb | 14 +++++------ .../ensure_connection_flow_spec.rb | 6 +++-- 46 files changed, 109 insertions(+), 71 deletions(-) create mode 100644 modules/storages/app/services/storages/storage_files_service.rb diff --git a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb index c275c310b732..72047520c102 100644 --- a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb +++ b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb @@ -61,7 +61,7 @@ def validate def capabilities @capabilities ||= Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.capabilities") + .resolve("#{@storage}.queries.capabilities") .call(storage: @storage, auth_strategy: noop) end diff --git a/modules/storages/app/common/storages/peripherals/one_drive_connection_validator.rb b/modules/storages/app/common/storages/peripherals/one_drive_connection_validator.rb index 478ca840985c..911f8280f51c 100644 --- a/modules/storages/app/common/storages/peripherals/one_drive_connection_validator.rb +++ b/modules/storages/app/common/storages/peripherals/one_drive_connection_validator.rb @@ -57,7 +57,7 @@ def validate def query @query ||= Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.files") + .resolve("#{@storage}.queries.files") .call(storage: @storage, auth_strategy:, folder: root_folder) end @@ -173,7 +173,7 @@ def root_folder end def auth_strategy - Peripherals::Registry.resolve("#{@storage.short_provider_type}.authentication.userless") + Peripherals::Registry.resolve("#{@storage}.authentication.userless") .call .with_cache(false) end diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/authentication.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/authentication.rb index 364f52427046..28617553f9c2 100644 --- a/modules/storages/app/common/storages/peripherals/storage_interaction/authentication.rb +++ b/modules/storages/app/common/storages/peripherals/storage_interaction/authentication.rb @@ -58,7 +58,7 @@ def self.authorization_state(storage:, user:) auth_strategy = AuthenticationStrategies::OAuthUserToken.strategy.with_user(user) Registry - .resolve("#{storage.short_provider_type}.queries.auth_check") + .resolve("#{storage}.queries.auth_check") .call(storage:, auth_strategy:) .match( on_success: ->(*) { :connected }, diff --git a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb index 0f8d107db56c..500628a42f38 100644 --- a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb +++ b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb @@ -8,7 +8,7 @@ ) do |form| flex_layout do |oauth_client_row| oauth_client_row.with_row(mb: 3) do - render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("storages.file_storage_view.#{storage.short_provider_type}_oauth") } + render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("storages.file_storage_view.#{storage}_oauth") } end oauth_client_row.with_row(mb: 3) do diff --git a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb index db9ee4cf6d34..d2fda9355e96 100644 --- a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb +++ b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb @@ -52,8 +52,8 @@ def cancel_button_path end def storage_provider_credentials_instructions - I18n.t("storages.instructions.#{storage.short_provider_type}.oauth_configuration", - application_link_text: send(:"#{storage.short_provider_type}_integration_link")).html_safe + I18n.t("storages.instructions.#{storage}.oauth_configuration", + application_link_text: send(:"#{storage}_integration_link")).html_safe end private diff --git a/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb b/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb index d6c7f7493413..04c67a9394bb 100644 --- a/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb +++ b/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb @@ -5,7 +5,7 @@ concat( render( Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-oauth-client-label') - ) { I18n.t("storages.file_storage_view.#{storage.short_provider_type}_oauth") } + ) { I18n.t("storages.file_storage_view.#{storage}_oauth") } ) concat(configuration_check_label_for(:storage_oauth_client_configured)) end diff --git a/modules/storages/app/components/storages/admin/oauth_client_info_component.rb b/modules/storages/app/components/storages/admin/oauth_client_info_component.rb index 71e3bbc37596..b4379d32cf89 100644 --- a/modules/storages/app/components/storages/admin/oauth_client_info_component.rb +++ b/modules/storages/app/components/storages/admin/oauth_client_info_component.rb @@ -46,7 +46,7 @@ def self.wrapper_key = :storage_oauth_client_section def edit_icon_button_options label = I18n.t("storages.buttons.replace_oauth_client", - provider_type: I18n.t("storages.provider_types.#{storage.short_provider_type}.name")) + provider_type: I18n.t("storages.provider_types.#{storage}.name")) { icon: oauth_client_configured? ? :sync : :pencil, @@ -64,7 +64,7 @@ def edit_icon_button_options def edit_icon_button_data_options {}.tap do |data_h| if oauth_client_configured? - provider_type = I18n.t("storages.provider_types.#{storage.short_provider_type}.name") + provider_type = I18n.t("storages.provider_types.#{storage}.name") data_h[:turbo_confirm] = I18n.t("storages.confirm_replace_oauth_client", provider_type:) end data_h[:turbo_stream] = true diff --git a/modules/storages/app/components/storages/admin/storage_row_component.html.erb b/modules/storages/app/components/storages/admin/storage_row_component.html.erb index ce9eaea2a5b6..d44b4819eb27 100644 --- a/modules/storages/app/components/storages/admin/storage_row_component.html.erb +++ b/modules/storages/app/components/storages/admin/storage_row_component.html.erb @@ -21,7 +21,7 @@ end grid.with_area(:provider, tag: :div, color: :subtle, mr: 3, hide: :sm, data: { 'test-selector': 'storage-provider' }) do - render(Primer::Beta::Truncate.new(font_weight: :light)) { I18n.t("storages.provider_types.#{storage.short_provider_type}.name") } + render(Primer::Beta::Truncate.new(font_weight: :light)) { I18n.t("storages.provider_types.#{storage}.name") } end grid.with_area(:time, tag: :div, color: :subtle) do diff --git a/modules/storages/app/components/storages/admin/storage_view_information.rb b/modules/storages/app/components/storages/admin/storage_view_information.rb index baf91d6b529e..2607670dd99f 100644 --- a/modules/storages/app/components/storages/admin/storage_view_information.rb +++ b/modules/storages/app/components/storages/admin/storage_view_information.rb @@ -9,7 +9,7 @@ def editable_storage? end def storage_description - [I18n.t("storages.provider_types.#{storage.short_provider_type}.name"), + [I18n.t("storages.provider_types.#{storage}.name"), storage.name, storage.host].compact.join(" - ") end @@ -62,7 +62,7 @@ def provider_oauth_client_description if storage.oauth_client "#{I18n.t('storages.label_oauth_client_id')}: #{storage.oauth_client.client_id}" else - I18n.t("storages.configuration_checks.oauth_client_incomplete.#{storage.short_provider_type}") + I18n.t("storages.configuration_checks.oauth_client_incomplete.#{storage}") end end @@ -70,7 +70,7 @@ def provider_redirect_uri_description if storage.oauth_client "#{I18n.t('storages.label_uri')}: #{storage.oauth_client.redirect_uri}" else - I18n.t("storages.configuration_checks.redirect_uri_incomplete.#{storage.short_provider_type}") + I18n.t("storages.configuration_checks.redirect_uri_incomplete.#{storage}") end end end diff --git a/modules/storages/app/components/storages/admin/storages/oauth_access_grant_nudge_modal_component.rb b/modules/storages/app/components/storages/admin/storages/oauth_access_grant_nudge_modal_component.rb index f879ab909b11..23cc88b340d1 100644 --- a/modules/storages/app/components/storages/admin/storages/oauth_access_grant_nudge_modal_component.rb +++ b/modules/storages/app/components/storages/admin/storages/oauth_access_grant_nudge_modal_component.rb @@ -57,7 +57,7 @@ def heading_text = I18n.t("storages.oauth_grant_nudge_modal.heading", provider_t def waiting_title = I18n.t("storages.oauth_grant_nudge_modal.requesting_access_to", storage: storage.name) def cancel_button_text = I18n.t(:button_close) def body_text = I18n.t("storages.oauth_grant_nudge_modal.storage_admin.description", provider_type:) - def provider_type = I18n.t("storages.provider_types.#{storage.short_provider_type}.name") + def provider_type = I18n.t("storages.provider_types.#{storage}.name") def login_button_aria_label I18n.t("storages.oauth_grant_nudge_modal.login_button_aria_label", storage: storage.name) diff --git a/modules/storages/app/controllers/storages/project_storages_controller.rb b/modules/storages/app/controllers/storages/project_storages_controller.rb index 36aab106ef62..cb3b738e4d37 100644 --- a/modules/storages/app/controllers/storages/project_storages_controller.rb +++ b/modules/storages/app/controllers/storages/project_storages_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -45,7 +47,7 @@ def open # check if user "see" project_folder if @object.project_folder_id.present? ::Storages::Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.file_info") + .resolve("#{@storage}.queries.file_info") .call(storage: @storage, auth_strategy:, file_id: @object.project_folder_id) .match( on_success: user_can_read_project_folder, diff --git a/modules/storages/app/forms/storages/admin/managed_project_folders/application_password_input.rb b/modules/storages/app/forms/storages/admin/managed_project_folders/application_password_input.rb index 429342b5800d..4e2609a2fc06 100644 --- a/modules/storages/app/forms/storages/admin/managed_project_folders/application_password_input.rb +++ b/modules/storages/app/forms/storages/admin/managed_project_folders/application_password_input.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -58,7 +60,7 @@ def provider_type_link href: Storages::UrlBuilder.url(@storage.uri, "settings/admin/openproject"), target: "_blank" ) - ) { I18n.t("storages.instructions.#{@storage.short_provider_type}.integration") } + ) { I18n.t("storages.instructions.#{@storage}.integration") } end end end diff --git a/modules/storages/app/forms/storages/admin/oauth_client_form.rb b/modules/storages/app/forms/storages/admin/oauth_client_form.rb index 35a61299b595..58ce31a07e3d 100644 --- a/modules/storages/app/forms/storages/admin/oauth_client_form.rb +++ b/modules/storages/app/forms/storages/admin/oauth_client_form.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -69,11 +71,11 @@ def provider_default_client_secret_input_options end def label_client_id - I18n.t("storages.provider_types.#{@storage.short_provider_type}.label_oauth_client_id") + I18n.t("storages.provider_types.#{@storage}.label_oauth_client_id") end def label_client_secret - I18n.t("storages.provider_types.#{@storage.short_provider_type}.label_oauth_client_secret") + I18n.t("storages.provider_types.#{@storage}.label_oauth_client_secret") end end end diff --git a/modules/storages/app/models/storages/project_storage.rb b/modules/storages/app/models/storages/project_storage.rb index 72ff63a3f5ff..5eee6413f308 100644 --- a/modules/storages/app/models/storages/project_storage.rb +++ b/modules/storages/app/models/storages/project_storage.rb @@ -88,11 +88,11 @@ def open(user) if project_folder_not_accessible?(user) Peripherals::Registry - .resolve("#{storage.short_provider_type}.queries.open_storage") + .resolve("#{storage}.queries.open_storage") .call(storage:, auth_strategy:) else Peripherals::Registry - .resolve("#{storage.short_provider_type}.queries.open_file_link") + .resolve("#{storage}.queries.open_file_link") .call(storage:, auth_strategy:, file_id: project_folder_id) end end @@ -118,7 +118,7 @@ def open_with_connection_ensured def managed_folder_identifier @managed_folder_identifier ||= - Peripherals::Registry.resolve("#{storage.short_provider_type}.models.managed_folder_identifier").new(self) + Peripherals::Registry.resolve("#{storage}.models.managed_folder_identifier").new(self) end def project_folder_not_accessible?(user) diff --git a/modules/storages/app/services/storages/oauth_applications/create_service.rb b/modules/storages/app/services/storages/oauth_applications/create_service.rb index 76120a879a87..e8c19d757ce8 100644 --- a/modules/storages/app/services/storages/oauth_applications/create_service.rb +++ b/modules/storages/app/services/storages/oauth_applications/create_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -45,7 +47,7 @@ def call ::OAuth::Applications::CreateService .new(user:) .call( - name: "#{storage.name} (#{I18n.t("storages.provider_types.#{storage.short_provider_type}.name")})", + name: "#{storage.name} (#{I18n.t("storages.provider_types.#{storage}.name")})", redirect_uri: File.join(storage.host, "index.php/apps/integration_openproject/oauth-redirect"), scopes: "api_v3", confidential: true, diff --git a/modules/storages/app/services/storages/project_storages/copy_project_folders_service.rb b/modules/storages/app/services/storages/project_storages/copy_project_folders_service.rb index de5059ca198f..3b3e4caae62e 100644 --- a/modules/storages/app/services/storages/project_storages/copy_project_folders_service.rb +++ b/modules/storages/app/services/storages/project_storages/copy_project_folders_service.rb @@ -74,7 +74,7 @@ def manually_managed_source?(source) def initiate_copy(storage, source_path, destination_path) Peripherals::Registry - .resolve("#{storage.short_provider_type}.commands.copy_template_folder") + .resolve("#{storage}.commands.copy_template_folder") .call(auth_strategy: auth_strategy(storage.short_provider_type), storage:, source_path:, diff --git a/modules/storages/app/services/storages/storage_files_service.rb b/modules/storages/app/services/storages/storage_files_service.rb new file mode 100644 index 000000000000..c554c2b4edfb --- /dev/null +++ b/modules/storages/app/services/storages/storage_files_service.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +#-- copyright +#++ + +module Storages + class StorageFilesService < BaseService + def self.call(storage:, user:, folder:) + new.call(storage:, user:, folder:) + end + + def call(user:, storage:, folder:) + auth_strategy = strategy(storage, user) + + Peripherals::Registry.resolve("#{storage}.queries.files").call(storage:, auth_strategy:, folder:) + end + + private + + def strategy(storage, user) + Peripherals::Registry.resolve("#{storage}.authentication.user_bound").call(user:) + end + end +end diff --git a/modules/storages/app/services/storages/storages/update_service.rb b/modules/storages/app/services/storages/storages/update_service.rb index efa30027ebbd..7f50b94f2ddd 100644 --- a/modules/storages/app/services/storages/storages/update_service.rb +++ b/modules/storages/app/services/storages/storages/update_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -32,7 +34,7 @@ class UpdateService < ::BaseServices::Update protected def after_perform(service_call) - super(service_call) + super storage = service_call.result if storage.provider_type_nextcloud? @@ -40,7 +42,7 @@ def after_perform(service_call) persist_service_result = ::OAuth::Applications::UpdateService .new(model: application, user:) .call( - name: "#{storage.name} (#{I18n.t("storages.provider_types.#{storage.short_provider_type}.name")})", + name: "#{storage.name} (#{I18n.t("storages.provider_types.#{storage}.name")})", redirect_uri: File.join(storage.host, "index.php/apps/integration_openproject/oauth-redirect") ) service_call.add_dependent!(persist_service_result) diff --git a/modules/storages/app/services/storages/upload_link_service.rb b/modules/storages/app/services/storages/upload_link_service.rb index 95040b50f205..f7620e14c76e 100644 --- a/modules/storages/app/services/storages/upload_link_service.rb +++ b/modules/storages/app/services/storages/upload_link_service.rb @@ -57,7 +57,7 @@ def call(user:, upload_data:) def request_upload_link(auth_strategy, upload_data) Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.upload_link") + .resolve("#{@storage}.queries.upload_link") .call(storage: @storage, auth_strategy:, upload_data:) .on_failure do |error| add_error(:base, error.errors, options: { storage_name: @storage.name, folder: upload_data.folder_id }) @@ -75,7 +75,7 @@ def validate_input(...) end def auth_strategy(user) - Peripherals::Registry.resolve("#{@storage.short_provider_type}.authentication.user_bound").call(user:) + Peripherals::Registry.resolve("#{@storage}.authentication.user_bound").call(user:) end end end diff --git a/modules/storages/app/views/storages/admin/storages/_new.html.erb b/modules/storages/app/views/storages/admin/storages/_new.html.erb index 37eabdfb3c99..3c315c263f29 100644 --- a/modules/storages/app/views/storages/admin/storages/_new.html.erb +++ b/modules/storages/app/views/storages/admin/storages/_new.html.erb @@ -55,7 +55,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.text_field :name, required: true, - placeholder: I18n.t("storages.provider_types.#{@storage.short_provider_type}.name_placeholder"), + placeholder: I18n.t("storages.provider_types.#{@storage}.name_placeholder"), container_class: '-slim', data: { 'storages--storage-form-target': 'storageName' diff --git a/modules/storages/app/views/storages/admin/storages/new.html.erb b/modules/storages/app/views/storages/admin/storages/new.html.erb index 53997a99e87e..487a108c1982 100644 --- a/modules/storages/app/views/storages/admin/storages/new.html.erb +++ b/modules/storages/app/views/storages/admin/storages/new.html.erb @@ -1,7 +1,7 @@ <% label_new_file_storage = t("storages.label_new_file_storage", - provider: t("storages.provider_types.#{@storage.short_provider_type}.name")) + provider: t("storages.provider_types.#{@storage}.name")) %> <% html_title t(:label_administration), t("project_module_storages"), label_new_file_storage %> @@ -18,8 +18,8 @@ <% header.with_description(test_selector: 'storage-new-page-header--description') do %> <%= t("storages.instructions.new_storage", - provider_link: ::OpenProject::Static::Links[:storage_docs][:"#{@storage.short_provider_type}_setup"][:href].html_safe, - provider_name: I18n.t("storages.provider_types.#{@storage.short_provider_type}.name") + provider_link: ::OpenProject::Static::Links[:storage_docs][:"#{@storage}_setup"][:href].html_safe, + provider_name: I18n.t("storages.provider_types.#{@storage}.name") ).html_safe %> <% end %> diff --git a/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb index e2ca4d7006e4..66c5f17c4d61 100644 --- a/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb +++ b/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb @@ -1,6 +1,6 @@ <% label_storage_provider_part = render(Primer::Beta::Text.new(tag: :span, font_weight: :light, color: :muted)) do - "(#{I18n.t("storages.provider_types.#{@storage.short_provider_type}.name")})" + "(#{I18n.t("storages.provider_types.#{@storage}.name")})" end label_storage_name_with_provider_label = "#{@storage.name} #{label_storage_provider_part}".html_safe %> diff --git a/modules/storages/app/views/storages/project_settings/_storage_select_form.html.erb b/modules/storages/app/views/storages/project_settings/_storage_select_form.html.erb index c245e35e4bee..08d265290ba2 100644 --- a/modules/storages/app/views/storages/project_settings/_storage_select_form.html.erb +++ b/modules/storages/app/views/storages/project_settings/_storage_select_form.html.erb @@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.select :storage_id, - @available_storages.map { |storage| ["#{storage.name} (#{storage.short_provider_type})", storage.id] }, + @available_storages.map { |storage| ["#{storage.name} (#{storage})", storage.id] }, class: '-bold', selected: @available_storages.first.id.to_s, container_class: '-slim' diff --git a/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb b/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb index 1e05c21b44c1..220df2dcb493 100644 --- a/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb +++ b/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb @@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details. <%= placeholder_cell('8px', vertical: true) %> - <%= I18n.t("storages.provider_types.#{storage.short_provider_type}.name") %> - <%= storage.uri %> + <%= I18n.t("storages.provider_types.#{storage}.name") %> - <%= storage.uri %> diff --git a/modules/storages/app/views/storages/storages_mailer/notify_healthy.text.erb b/modules/storages/app/views/storages/storages_mailer/notify_healthy.text.erb index 488f0c42d536..7aa05229ab5d 100644 --- a/modules/storages/app/views/storages/storages_mailer/notify_healthy.text.erb +++ b/modules/storages/app/views/storages/storages_mailer/notify_healthy.text.erb @@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details. <%= I18n.t('mail.storages.health.plaintext.healthy.summary', storage_name: @storage.name) %> -<%= I18n.t('mail.storages.health.plaintext.storage') %>: <%= I18n.t("storages.provider_types.#{@storage.short_provider_type}.name") %> - <%= @storage.host %> +<%= I18n.t('mail.storages.health.plaintext.storage') %>: <%= I18n.t("storages.provider_types.#{@storage}.name") %> - <%= @storage.host %> <%= I18n.t('mail.storages.health.plaintext.unhealthy.error-details') %>: <%= "-" * 30 %> diff --git a/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.text.erb b/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.text.erb index 57c232ae5364..ae03895cc21f 100644 --- a/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.text.erb +++ b/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.text.erb @@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details. <%= I18n.t('mail.storages.health.plaintext.unhealthy.summary', storage_name: @storage.name) %> -<%= I18n.t('mail.storages.health.plaintext.storage') %>: <%= I18n.t("storages.provider_types.#{@storage.short_provider_type}.name") %> - <%= @storage.host %> +<%= I18n.t('mail.storages.health.plaintext.storage') %>: <%= I18n.t("storages.provider_types.#{@storage}.name") %> - <%= @storage.host %> <%= I18n.t('mail.storages.health.plaintext.unhealthy.error-details') %>: <%= "-" * 30 %> diff --git a/modules/storages/app/workers/storages/automatically_managed_storage_sync_job.rb b/modules/storages/app/workers/storages/automatically_managed_storage_sync_job.rb index ecd7544675cf..801518c2c15f 100644 --- a/modules/storages/app/workers/storages/automatically_managed_storage_sync_job.rb +++ b/modules/storages/app/workers/storages/automatically_managed_storage_sync_job.rb @@ -52,7 +52,7 @@ class AutomaticallyManagedStorageSyncJob < ApplicationJob end end - def self.key(storage) = "sync-#{storage.short_provider_type}-#{storage.id}" + def self.key(storage) = "sync-#{storage}-#{storage.id}" def perform(storage) return unless storage.configured? && storage.automatically_managed? diff --git a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb index a687ab8e5d88..e1102ec15b71 100644 --- a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb +++ b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb @@ -52,23 +52,19 @@ def validate_upload_request(body) def fetch_upload_link lambda do |upload_data| - Rails.logger.error "UploadLink #{upload_data.inspect}" Storages::UploadLinkService.call(storage: @storage, upload_data:, user: current_user) end end def auth_strategy - Storages::Peripherals::Registry - .resolve("#{@storage.short_provider_type}.authentication.user_bound") - .call(user: current_user) + Storages::Peripherals::Registry.resolve("#{@storage}.authentication.user_bound").call(user: current_user) end end resources :files do get do - Storages::Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.files") - .call(storage: @storage, auth_strategy:, folder: extract_parent_folder(params)) + Storages::StorageFilesService + .call(storage: @storage, user: current_user, folder: extract_parent_folder(params)) .match( on_success: ->(files) { API::V3::StorageFiles::StorageFilesRepresenter.new(files, @storage, current_user:) }, on_failure: ->(error) { raise_error(error) } @@ -78,7 +74,7 @@ def auth_strategy route_param :file_id, type: String, desc: "Storage file id" do get do Storages::Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.file_info") + .resolve("#{@storage}.queries.file_info") .call(storage: @storage, auth_strategy:, file_id: params[:file_id]) .map { |file_info| to_storage_file(file_info) } .match( diff --git a/modules/storages/lib/api/v3/storages/storage_open_api.rb b/modules/storages/lib/api/v3/storages/storage_open_api.rb index 752f3fadc6b3..937c33ba6015 100644 --- a/modules/storages/lib/api/v3/storages/storage_open_api.rb +++ b/modules/storages/lib/api/v3/storages/storage_open_api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -38,7 +40,7 @@ class API::V3::Storages::StorageOpenAPI < API::OpenProjectAPI .with_user(current_user) Storages::Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.open_storage") + .resolve("#{@storage}.queries.open_storage") .call(storage: @storage, auth_strategy:) .match( on_success: ->(url) do 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.rb index f9ddf0a3b403..b34027fbb671 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 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -31,7 +33,7 @@ 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}.queries.capabilities", ->(_) { capabilities_response }) Storages::Peripherals::Registry.stub("#{storage.short_provider_type}.queries.files", ->(_) { files_response }) end diff --git a/modules/storages/spec/common/storages/peripherals/one_drive_connection_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/one_drive_connection_validator_spec.rb index 07a1ee456f89..26bdc47292bc 100644 --- a/modules/storages/spec/common/storages/peripherals/one_drive_connection_validator_spec.rb +++ b/modules/storages/spec/common/storages/peripherals/one_drive_connection_validator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -33,7 +35,7 @@ let(:storage) { create(:one_drive_storage, oauth_client: create(:oauth_client)) } before do - Storages::Peripherals::Registry.stub("#{storage.short_provider_type}.queries.files", ->(_) { response }) + Storages::Peripherals::Registry.stub("#{storage}.queries.files", ->(_) { response }) end subject { described_class.new(storage:).validate } diff --git a/modules/storages/spec/features/create_file_links_spec.rb b/modules/storages/spec/features/create_file_links_spec.rb index d6feb7a9f8af..5dac613cef50 100644 --- a/modules/storages/spec/features/create_file_links_spec.rb +++ b/modules/storages/spec/features/create_file_links_spec.rb @@ -63,7 +63,7 @@ allow(Storages::FileLinkSyncService).to receive(:new).and_return(sync_service) Storages::Peripherals::Registry.stub( - "#{storage.short_provider_type}.queries.auth_check", + "#{storage}.queries.auth_check", ->(_) { ServiceResult.success } ) diff --git a/modules/storages/spec/features/manage_project_storage_spec.rb b/modules/storages/spec/features/manage_project_storage_spec.rb index a13d14e31129..2acbb325d66e 100644 --- a/modules/storages/spec/features/manage_project_storage_spec.rb +++ b/modules/storages/spec/features/manage_project_storage_spec.rb @@ -97,7 +97,7 @@ expect(page).to have_current_path new_project_settings_project_storage_path(project_id: project) expect(page).to have_text("Add a file storage") expect(page).to have_select("storages_project_storage_storage_id", - options: ["#{storage.name} (#{storage.short_provider_type})"]) + options: ["#{storage.name} (#{storage})"]) page.click_on("Continue") # by default automatic have to be choosen if storage has automatic management enabled diff --git a/modules/storages/spec/features/show_file_links_spec.rb b/modules/storages/spec/features/show_file_links_spec.rb index e6c4445003cc..74562ff1520d 100644 --- a/modules/storages/spec/features/show_file_links_spec.rb +++ b/modules/storages/spec/features/show_file_links_spec.rb @@ -49,7 +49,7 @@ before do Storages::Peripherals::Registry.stub( - "#{storage.short_provider_type}.queries.auth_check", + "#{storage}.queries.auth_check", ->(_) { authorization_state } ) diff --git a/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb b/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb index dcafe17a51c8..ffc4b5ab7bec 100644 --- a/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb +++ b/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb @@ -41,7 +41,7 @@ before do Storages::Peripherals::Registry.stub( - "#{storage.short_provider_type}.queries.auth_check", + "#{storage}.queries.auth_check", ->(_) { auth_check_result } ) end diff --git a/modules/storages/spec/services/storages/oauth_applications/create_service_spec.rb b/modules/storages/spec/services/storages/oauth_applications/create_service_spec.rb index c8aa5522765d..41b0b9ddae11 100644 --- a/modules/storages/spec/services/storages/oauth_applications/create_service_spec.rb +++ b/modules/storages/spec/services/storages/oauth_applications/create_service_spec.rb @@ -46,7 +46,7 @@ expect(subject).to be_success expect(subject.result).to be_a Doorkeeper::Application expect(subject.result.name).to include storage.name - expect(subject.result.name).to include I18n.t("storages.provider_types.#{storage.short_provider_type}.name") + expect(subject.result.name).to include I18n.t("storages.provider_types.#{storage}.name") expect(subject.result.scopes.to_s).to eql "api_v3" expect(subject.result.redirect_uri).to include storage.host expect(subject.result.redirect_uri).to include "apps/integration_openproject/oauth-redirect" diff --git a/modules/storages/spec/services/storages/project_storages/delete_service_spec.rb b/modules/storages/spec/services/storages/project_storages/delete_service_spec.rb index 10f3980ee4f0..478abae6cdcb 100644 --- a/modules/storages/spec/services/storages/project_storages/delete_service_spec.rb +++ b/modules/storages/spec/services/storages/project_storages/delete_service_spec.rb @@ -39,7 +39,7 @@ before do Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.commands.delete_folder", command_double) + .stub("#{storage}.commands.delete_folder", command_double) end context "if project folder mode is set to automatic" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/create_folder_command_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/create_folder_command_examples.rb index 86ba8fe62a9d..7c68f2cc7626 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/create_folder_command_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/create_folder_command_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "create_folder_command: basic command setup" do it "is registered as commands.create_folder" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.commands.create_folder")).to eq(described_class) + .resolve("#{storage}.commands.create_folder")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/file_info_query_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/file_info_query_examples.rb index e0777b059094..df8cbe493e47 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/file_info_query_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/file_info_query_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "file_info_query: basic query setup" do it "is registered as queries.file_info" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.queries.file_info")).to eq(described_class) + .resolve("#{storage}.queries.file_info")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/file_path_to_id_map_query_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/file_path_to_id_map_query_examples.rb index 6abec5e19218..6d84b31c2a76 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/file_path_to_id_map_query_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/file_path_to_id_map_query_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "file_path_to_id_map_query: basic query setup" do it "is registered as queries.file_path_to_id_map" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.queries.file_path_to_id_map")).to eq(described_class) + .resolve("#{storage}.queries.file_path_to_id_map")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/files_query_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/files_query_examples.rb index 7e68098f9c59..17a156294278 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/files_query_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/files_query_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "files_query: basic query setup" do it "is registered as queries.files" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.queries.files")).to eq(described_class) + .resolve("#{storage}.queries.files")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/rename_file_command_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/rename_file_command_examples.rb index 3fc9d4e55a70..1f71426f20c0 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/rename_file_command_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/rename_file_command_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "rename_file_command: basic command setup" do it "is registered as commands.rename_file" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.commands.rename_file")).to eq(described_class) + .resolve("#{storage}.commands.rename_file")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/set_permissions_command_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/set_permissions_command_examples.rb index d6e7926d906d..2e423ea664e9 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/set_permissions_command_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/set_permissions_command_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "set_permissions_command: basic command setup" do it "is registered as commands.set_permissions" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.commands.set_permissions")).to eq(described_class) + .resolve("#{storage}.commands.set_permissions")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/support/shared_examples_for_adapters/upload_link_query_examples.rb b/modules/storages/spec/support/shared_examples_for_adapters/upload_link_query_examples.rb index 6c527700ff93..5b8906668120 100644 --- a/modules/storages/spec/support/shared_examples_for_adapters/upload_link_query_examples.rb +++ b/modules/storages/spec/support/shared_examples_for_adapters/upload_link_query_examples.rb @@ -31,7 +31,7 @@ RSpec.shared_examples_for "upload_link_query: basic query setup" do it "is registered as queries.upload_link" do expect(Storages::Peripherals::Registry - .resolve("#{storage.short_provider_type}.queries.upload_link")).to eq(described_class) + .resolve("#{storage}.queries.upload_link")).to eq(described_class) end it "responds to #call with correct parameters" do diff --git a/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb b/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb index 33b45c4ff145..73684682c11d 100644 --- a/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb +++ b/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb @@ -123,17 +123,17 @@ describe "managed project folders" do before do Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.queries.file_path_to_id_map", lambda { |storage:, auth_strategy:, folder:| + .stub("#{storage}.queries.file_path_to_id_map", lambda { |storage:, auth_strategy:, folder:| ServiceResult.success(result: target_deep_file_ids) }) Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.queries.files_info", lambda { |storage:, auth_strategy:, file_ids:| + .stub("#{storage}.queries.files_info", lambda { |storage:, auth_strategy:, file_ids:| ServiceResult.success(result: source_file_infos) }) Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.commands.copy_template_folder", + .stub("#{storage}.commands.copy_template_folder", lambda { |auth_strategy:, storage:, source_path:, destination_path:| ServiceResult.success(result: copy_result.with(id: "copied-folder", polling_url:)) }) @@ -172,18 +172,18 @@ before do Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.commands.copy_template_folder", + .stub("#{storage}.commands.copy_template_folder", lambda { |auth_strategy:, storage:, source_path:, destination_path:| ServiceResult.success(result: copy_result.with(polling_url:, requires_polling: true)) }) Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.queries.file_path_to_id_map", lambda { |storage:, auth_strategy:, folder:| + .stub("#{storage}.queries.file_path_to_id_map", lambda { |storage:, auth_strategy:, folder:| ServiceResult.success(result: target_deep_file_ids) }) Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.queries.files_info", lambda { |storage:, auth_strategy:, file_ids:| + .stub("#{storage}.queries.files_info", lambda { |storage:, auth_strategy:, file_ids:| ServiceResult.success(result: source_file_infos) }) @@ -238,7 +238,7 @@ context "when an error occurs" do before do Storages::Peripherals::Registry - .stub("#{storage.short_provider_type}.commands.copy_template_folder", + .stub("#{storage}.commands.copy_template_folder", lambda { |auth_strategy:, storage:, source_path:, destination_path:| ServiceResult.failure( result: :error, diff --git a/spec/requests/oauth_clients/ensure_connection_flow_spec.rb b/spec/requests/oauth_clients/ensure_connection_flow_spec.rb index 7cd2f3d80c90..b7ac2e2943ea 100644 --- a/spec/requests/oauth_clients/ensure_connection_flow_spec.rb +++ b/spec/requests/oauth_clients/ensure_connection_flow_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -36,7 +38,7 @@ before do Storages::Peripherals::Registry.stub( - "#{storage.short_provider_type}.queries.auth_check", + "#{storage}.queries.auth_check", ->(_) { ServiceResult.success } ) end @@ -64,7 +66,7 @@ before do Storages::Peripherals::Registry.stub( - "#{storage.short_provider_type}.queries.auth_check", + "#{storage}.queries.auth_check", ->(_) { ServiceResult.failure(errors: Storages::StorageError.new(code: :unauthorized)) } ) From 3214cd78cb2673268fe1d57a4717446010a1b0f1 Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Wed, 18 Sep 2024 13:00:12 +0200 Subject: [PATCH 2/8] Update copyright where missing --- .../admin/storage_view_information.rb | 28 +++++++++++ .../open_project_storage_modal_component.rb | 4 ++ .../body.rb | 6 ++- .../storages/storages/base_contract.rb | 2 +- .../storages/storages/create_contract.rb | 2 +- .../storages/storages/nextcloud_contract.rb | 2 +- .../storages/storages/one_drive_contract.rb | 2 +- .../storages/storages/update_contract.rb | 2 +- .../projects/filter/storages_filter.rb | 4 +- .../services/storages/storage_file_service.rb | 50 +++++++++++++++++++ .../storages/storage_files_service.rb | 26 ++++++++++ .../api/v3/storage_files/storage_files_api.rb | 5 +- modules/storages/lib/openproject-storages.rb | 30 +++++++++++ .../mailers/storages/storages_mailer_spec.rb | 31 ++++++++++++ 14 files changed, 183 insertions(+), 11 deletions(-) create mode 100644 modules/storages/app/services/storages/storage_file_service.rb diff --git a/modules/storages/app/components/storages/admin/storage_view_information.rb b/modules/storages/app/components/storages/admin/storage_view_information.rb index 2607670dd99f..d019b95d3835 100644 --- a/modules/storages/app/components/storages/admin/storage_view_information.rb +++ b/modules/storages/app/components/storages/admin/storage_view_information.rb @@ -1,5 +1,33 @@ # frozen_string_literal: true +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + module Storages::Admin module StorageViewInformation private diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component.rb b/modules/storages/app/components/storages/open_project_storage_modal_component.rb index 9ad4d22c8981..7af3c0811d76 100644 --- a/modules/storages/app/components/storages/open_project_storage_modal_component.rb +++ b/modules/storages/app/components/storages/open_project_storage_modal_component.rb @@ -1,3 +1,7 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # # This program is free software; you can redistribute it and/or diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb b/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb index 583760190f1e..880848165a17 100644 --- a/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb +++ b/modules/storages/app/components/storages/open_project_storage_modal_component/body.rb @@ -1,3 +1,7 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # # This program is free software; you can redistribute it and/or @@ -24,7 +28,7 @@ # See COPYRIGHT and LICENSE files for more details. #++ -class Storages::OpenProjectStorageModalComponent::Body < ApplicationComponent # rubocop:disable OpenProject/AddPreviewForViewComponent +class Storages::OpenProjectStorageModalComponent::Body < ApplicationComponent options success_title: I18n.t("storages.open_project_storage_modal.success.title"), success_subtitle: I18n.t("storages.open_project_storage_modal.success.subtitle"), waiting_title: I18n.t("storages.open_project_storage_modal.waiting.title"), diff --git a/modules/storages/app/contracts/storages/storages/base_contract.rb b/modules/storages/app/contracts/storages/storages/base_contract.rb index 24180cddf275..9ba945989d20 100644 --- a/modules/storages/app/contracts/storages/storages/base_contract.rb +++ b/modules/storages/app/contracts/storages/storages/base_contract.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# -- copyright +#-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # diff --git a/modules/storages/app/contracts/storages/storages/create_contract.rb b/modules/storages/app/contracts/storages/storages/create_contract.rb index d387a435fcb0..f884f3e90442 100644 --- a/modules/storages/app/contracts/storages/storages/create_contract.rb +++ b/modules/storages/app/contracts/storages/storages/create_contract.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# -- copyright +#-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # diff --git a/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb b/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb index 88f9089d3e08..7f718f7e9d5e 100644 --- a/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb +++ b/modules/storages/app/contracts/storages/storages/nextcloud_contract.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# -- copyright +#-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # diff --git a/modules/storages/app/contracts/storages/storages/one_drive_contract.rb b/modules/storages/app/contracts/storages/storages/one_drive_contract.rb index 76fd7a62b0b7..b23554409441 100644 --- a/modules/storages/app/contracts/storages/storages/one_drive_contract.rb +++ b/modules/storages/app/contracts/storages/storages/one_drive_contract.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# -- copyright +#-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # diff --git a/modules/storages/app/contracts/storages/storages/update_contract.rb b/modules/storages/app/contracts/storages/storages/update_contract.rb index e78ff523ff6f..1345ed147a6a 100644 --- a/modules/storages/app/contracts/storages/storages/update_contract.rb +++ b/modules/storages/app/contracts/storages/storages/update_contract.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# -- copyright +#-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # diff --git a/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb b/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb index 8b6d563d43e4..b1c620aad78f 100644 --- a/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb +++ b/modules/storages/app/models/queries/storages/projects/filter/storages_filter.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# -- copyright +#-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH # @@ -26,7 +26,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # See COPYRIGHT and LICENSE files for more details. -# ++ +#++ # # This filter is used to find projects (including archived projects) that use one diff --git a/modules/storages/app/services/storages/storage_file_service.rb b/modules/storages/app/services/storages/storage_file_service.rb new file mode 100644 index 000000000000..6a00ac7653c1 --- /dev/null +++ b/modules/storages/app/services/storages/storage_file_service.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Storages + class StorageFileService < BaseService + def self.call(storage:, user:, file_id:) + new.call(storage:, user:, file_id:) + end + + def call(user:, storage:, file_id:) + auth_strategy = strategy(storage, user) + + info "Requesting file #{file_id} information on #{storage.name}" + Peripherals::Registry.resolve("#{storage}.queries.file_info").call(storage:, auth_strategy:, folder:) + end + + private + + def strategy(storage, user) + Peripherals::Registry.resolve("#{storage}.authentication.user_bound").call(user:) + end + end +end diff --git a/modules/storages/app/services/storages/storage_files_service.rb b/modules/storages/app/services/storages/storage_files_service.rb index c554c2b4edfb..ce4ab8f9a4bc 100644 --- a/modules/storages/app/services/storages/storage_files_service.rb +++ b/modules/storages/app/services/storages/storage_files_service.rb @@ -1,6 +1,31 @@ # frozen_string_literal: true #-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. #++ module Storages @@ -12,6 +37,7 @@ def self.call(storage:, user:, folder:) def call(user:, storage:, folder:) auth_strategy = strategy(storage, user) + info "Requesting all the files under folder #{folder} for #{storage.name}" Peripherals::Registry.resolve("#{storage}.queries.files").call(storage:, auth_strategy:, folder:) end diff --git a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb index e1102ec15b71..cf083a9351fc 100644 --- a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb +++ b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb @@ -73,9 +73,8 @@ def auth_strategy route_param :file_id, type: String, desc: "Storage file id" do get do - Storages::Peripherals::Registry - .resolve("#{@storage}.queries.file_info") - .call(storage: @storage, auth_strategy:, file_id: params[:file_id]) + Storages::StorageFilesService + .call(storage: @storage, user: current_user, file_id: params[:file_id]) .map { |file_info| to_storage_file(file_info) } .match( on_success: lambda { |storage_file| diff --git a/modules/storages/lib/openproject-storages.rb b/modules/storages/lib/openproject-storages.rb index 0b8622e544c5..bcc8556dbe2d 100644 --- a/modules/storages/lib/openproject-storages.rb +++ b/modules/storages/lib/openproject-storages.rb @@ -1,3 +1,33 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + # The module follows a structure similar to gems. # The name 'openproject-storages' was set with the open_project:plugin generator. # The OpenProject plugins, located in modules/, are defined in `Gemfile.modules`. diff --git a/modules/storages/spec/mailers/storages/storages_mailer_spec.rb b/modules/storages/spec/mailers/storages/storages_mailer_spec.rb index a58bd8cf07f5..986022334fc1 100644 --- a/modules/storages/spec/mailers/storages/storages_mailer_spec.rb +++ b/modules/storages/spec/mailers/storages/storages_mailer_spec.rb @@ -1,4 +1,35 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + require "rails_helper" +require_module_spec_helper RSpec.describe Storages::StoragesMailer do let(:admin) { build_stubbed(:admin) } From 59c92f41aebfc250f6e7a558359d4271ccf6e557 Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Wed, 18 Sep 2024 15:28:19 +0200 Subject: [PATCH 3/8] Update tests to rely on the registry --- .../services/storages/storage_file_service.rb | 2 +- .../api/v3/storage_files/storage_files_api.rb | 2 +- .../api/v3/storages/storage_files_api_spec.rb | 17 +++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/storages/app/services/storages/storage_file_service.rb b/modules/storages/app/services/storages/storage_file_service.rb index 6a00ac7653c1..6b664d92f1a5 100644 --- a/modules/storages/app/services/storages/storage_file_service.rb +++ b/modules/storages/app/services/storages/storage_file_service.rb @@ -38,7 +38,7 @@ def call(user:, storage:, file_id:) auth_strategy = strategy(storage, user) info "Requesting file #{file_id} information on #{storage.name}" - Peripherals::Registry.resolve("#{storage}.queries.file_info").call(storage:, auth_strategy:, folder:) + Peripherals::Registry.resolve("#{storage}.queries.file_info").call(storage:, auth_strategy:, file_id:) end private diff --git a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb index cf083a9351fc..e57499758623 100644 --- a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb +++ b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb @@ -73,7 +73,7 @@ def auth_strategy route_param :file_id, type: String, desc: "Storage file id" do get do - Storages::StorageFilesService + Storages::StorageFileService .call(storage: @storage, user: current_user, file_id: params[:file_id]) .map { |file_info| to_storage_file(file_info) } .match( diff --git a/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb b/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb index 4f5d4265c118..049ae17fb7d0 100644 --- a/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb +++ b/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb @@ -43,14 +43,14 @@ end let(:oauth_application) { create(:oauth_application) } - let(:storage) { create(:nextcloud_storage, creator: current_user, oauth_application:) } + let(:storage) { create(:nextcloud_storage_configured, creator: current_user, oauth_application:) } + let(:oauth_token) { create(:oauth_client_token, user: current_user, oauth_client: storage.oauth_client) } let(:project_storage) { create(:project_storage, project:, storage:) } - subject(:last_response) do - get path - end + subject(:last_response) { get path } before do + oauth_application project_storage login_as current_user end @@ -205,12 +205,9 @@ context "with query failed" do before do - clazz = Storages::Peripherals::StorageInteraction::Nextcloud::FileInfoQuery - instance = instance_double(clazz) - allow(clazz).to receive(:new).and_return(instance) - allow(instance).to receive(:call).and_return( - ServiceResult.failure(result: error, errors: Storages::StorageError.new(code: error)) - ) + Storages::Peripherals::Registry + .stub("#{storage}.queries.file_info", + ->(_) { ServiceResult.failure(result: error, errors: Storages::StorageError.new(code: error)) }) end context "with authorization failure" do From afef8ae280998ff2ec58efbfdba5c4fd3baa68e8 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Tue, 24 Sep 2024 15:05:03 +0200 Subject: [PATCH 4/8] [#58010] fixed input data for upload query - https://community.openproject.org/work_packages/58010 - changed input data for file upload to be blank id, and not parent folder object --- .../peripherals/storage_interaction/inputs/upload_data.rb | 6 +++--- .../storages/app/services/storages/upload_link_service.rb | 7 +++---- .../lib/api/v3/storage_files/storage_files_api.rb | 1 - .../storage_interaction/inputs/upload_data_spec.rb | 8 ++++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/inputs/upload_data.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/inputs/upload_data.rb index c08f2e47d57f..80ed8c417e0a 100644 --- a/modules/storages/app/common/storages/peripherals/storage_interaction/inputs/upload_data.rb +++ b/modules/storages/app/common/storages/peripherals/storage_interaction/inputs/upload_data.rb @@ -36,9 +36,9 @@ module Inputs private_class_method :new def self.build(folder_id:, file_name:, contract: UploadDataContract.new) - contract.call(folder_id:, file_name:).to_monad.fmap do |result| - new(file_name: result[:file_name], folder_id: ParentFolder.new(result[:folder_id])) - end + contract.call(folder_id:, file_name:) + .to_monad + .fmap { |result| new(file_name: result[:file_name], folder_id: result[:folder_id]) } end end end diff --git a/modules/storages/app/services/storages/upload_link_service.rb b/modules/storages/app/services/storages/upload_link_service.rb index 95040b50f205..012b5c8433d7 100644 --- a/modules/storages/app/services/storages/upload_link_service.rb +++ b/modules/storages/app/services/storages/upload_link_service.rb @@ -56,10 +56,9 @@ def call(user:, upload_data:) private def request_upload_link(auth_strategy, upload_data) - Peripherals::Registry - .resolve("#{@storage.short_provider_type}.queries.upload_link") - .call(storage: @storage, auth_strategy:, upload_data:) - .on_failure do |error| + Peripherals::Registry.resolve("#{@storage.short_provider_type}.queries.upload_link") + .call(storage: @storage, auth_strategy:, upload_data:) + .on_failure do |error| add_error(:base, error.errors, options: { storage_name: @storage.name, folder: upload_data.folder_id }) log_storage_error(error.errors) @result.success = false diff --git a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb index a687ab8e5d88..9cb8f73d9c06 100644 --- a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb +++ b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb @@ -52,7 +52,6 @@ def validate_upload_request(body) def fetch_upload_link lambda do |upload_data| - Rails.logger.error "UploadLink #{upload_data.inspect}" Storages::UploadLinkService.call(storage: @storage, upload_data:, user: current_user) end end diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/inputs/upload_data_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/inputs/upload_data_spec.rb index d0953678aaaa..4a44fd9d64a9 100644 --- a/modules/storages/spec/common/storages/peripherals/storage_interaction/inputs/upload_data_spec.rb +++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/inputs/upload_data_spec.rb @@ -39,17 +39,17 @@ end it "returns a Success(UploadData)" do - result = input.build(folder_id: "/Folder/Subfolder", file_name: "i_am_file_with_a_name.txt") + result = input.build(folder_id: "1337", file_name: "i_am_file_with_a_name.txt") expect(result).to be_success upload_data = result.value! - expect(upload_data.folder_id).to eq(Storages::Peripherals::ParentFolder.new("/Folder/Subfolder")) + expect(upload_data.folder_id).to eq("1337") expect(upload_data.file_name).to eq("i_am_file_with_a_name.txt") end context "when invalid" do context "with a nil file name" do - let(:kwargs) { { folder_id: "/folder", file_name: nil } } + let(:kwargs) { { folder_id: "42", file_name: nil } } it "returns a failure" do result = input.build(**kwargs) @@ -63,7 +63,7 @@ end context "with a empty file name" do - let(:kwargs) { { folder_id: "/folder", file_name: "" } } + let(:kwargs) { { folder_id: "42", file_name: "" } } it "returns a failure" do result = input.build(**kwargs) From 8ab01f67e41aa5fece9375ae68e65201a4a06934 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 05:06:20 +0000 Subject: [PATCH 5/8] build(deps-dev): bump selenium-devtools from 0.128.0 to 0.129.0 Bumps [selenium-devtools](https://github.com/SeleniumHQ/selenium) from 0.128.0 to 0.129.0. - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES) - [Commits](https://github.com/SeleniumHQ/selenium/commits) --- updated-dependencies: - dependency-name: selenium-devtools dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 410cfbd01525..939c48ef7612 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1055,7 +1055,7 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) secure_headers (6.5.0) - selenium-devtools (0.128.0) + selenium-devtools (0.129.0) selenium-webdriver (~> 4.2) selenium-webdriver (4.25.0) base64 (~> 0.2) From 74ad9f5f0a20dcd91347ff2bd1442eaa7bb6882e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 05:34:57 +0000 Subject: [PATCH 6/8] build(deps): bump codemirror from 5.65.17 to 5.65.18 in /frontend Bumps [codemirror](https://github.com/codemirror/basic-setup) from 5.65.17 to 5.65.18. - [Changelog](https://github.com/codemirror/basic-setup/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/basic-setup/commits) --- updated-dependencies: - dependency-name: codemirror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- frontend/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 58998d430f21..c61b903563c7 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8286,9 +8286,9 @@ } }, "node_modules/codemirror": { - "version": "5.65.17", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.17.tgz", - "integrity": "sha512-1zOsUx3lzAOu/gnMAZkQ9kpIHcPYOc9y1Fbm2UVk5UBPkdq380nhkelG0qUwm1f7wPvTbndu9ZYlug35EwAZRQ==" + "version": "5.65.18", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.18.tgz", + "integrity": "sha512-Gaz4gHnkbHMGgahNt3CA5HBk5lLQBqmD/pBgeB4kQU6OedZmqMBjlRF0LSrp2tJ4wlLNPm2FfaUd1pDy0mdlpA==" }, "node_modules/collection-visit": { "version": "1.0.0", @@ -27976,9 +27976,9 @@ } }, "codemirror": { - "version": "5.65.17", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.17.tgz", - "integrity": "sha512-1zOsUx3lzAOu/gnMAZkQ9kpIHcPYOc9y1Fbm2UVk5UBPkdq380nhkelG0qUwm1f7wPvTbndu9ZYlug35EwAZRQ==" + "version": "5.65.18", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.18.tgz", + "integrity": "sha512-Gaz4gHnkbHMGgahNt3CA5HBk5lLQBqmD/pBgeB4kQU6OedZmqMBjlRF0LSrp2tJ4wlLNPm2FfaUd1pDy0mdlpA==" }, "collection-visit": { "version": "1.0.0", From a639352ae3d376fcec4cd3c5e46d1b86f0302314 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 06:53:23 +0000 Subject: [PATCH 7/8] build(deps): bump webrick from 1.8.1 to 1.8.2 Bumps [webrick](https://github.com/ruby/webrick) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/ruby/webrick/releases) - [Commits](https://github.com/ruby/webrick/compare/v1.8.1...v1.8.2) --- updated-dependencies: - dependency-name: webrick dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 410cfbd01525..66ec72cca45e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1171,7 +1171,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.1) + webrick (1.8.2) websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) From 34805e1ae062f4c0be1e8e1b28c6124e303fe3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 25 Sep 2024 09:08:58 +0200 Subject: [PATCH 8/8] Set repo ID --- docker/prod/artifacthub-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/prod/artifacthub-repo.yml b/docker/prod/artifacthub-repo.yml index 838eea3382e3..96ec962adbd1 100644 --- a/docker/prod/artifacthub-repo.yml +++ b/docker/prod/artifacthub-repo.yml @@ -9,7 +9,7 @@ # when the hash of the last commit in the branch you set up changes. This does # NOT apply to ownership claim operations, which are processed immediately. # -repositoryID: openproject +repositoryID: 25516830-632d-470a-8eb8-6a5da9b48192 owners: - name: oliverguenther email: o.guenther@openproject.com