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

[#66439] added tagged logging

Eric Schubertfbfe088ad4cd
diff --git a/modules/storages/app/common/storages/adapters/providers/share_point/queries/download_link_query.rb b/modules/storages/app/common/storages/adapters/providers/share_point/queries/download_link_query.rb
index 2fceddde675..fe8d2996968 100644
--- a/modules/storages/app/common/storages/adapters/providers/share_point/queries/download_link_query.rb
+++ b/modules/storages/app/common/storages/adapters/providers/share_point/queries/download_link_query.rb
@@ -35,9 +35,12 @@ module Storages
module Queries
class DownloadLinkQuery < Base
def call(auth_strategy:, input_data:)
- Authentication[auth_strategy].call(storage: @storage) do |http|
- uri = request_uri(**split_identifier(input_data.file_link.origin_id))
- handle_errors http.get(uri)
+ with_tagged_logger do
+ Authentication[auth_strategy].call(storage: @storage) do |http|
+ split_identifier(input_data.file_link.origin_id) => { drive_id:, location: }
+ info "Fetching download link for drive item #{location} on drive #{drive_id}."
+ handle_errors http.get(request_uri(drive_id:, location:))
+ end
end
end
diff --git a/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb b/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb
index 29c27a7e493..7808fca5022 100644
--- a/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb
+++ b/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb
@@ -37,12 +37,16 @@ module Storages
FIELDS = %w[id name fileSystemInfo file folder size createdBy lastModifiedBy parentReference webUrl].freeze
def call(auth_strategy:, input_data:)
- split_identifier(input_data.file_id) => { drive_id:, location: item_id }
+ with_tagged_logger do
+ split_identifier(input_data.file_id) => { drive_id:, location: item_id }
- fetch_file_info(auth_strategy:, drive_id:, item_id:).or do |error|
- return Failure(error) unless error.code == :not_found && auth_strategy.value!.user.present?
+ info "Fetch file info for drive item #{item_id} on drive #{drive_id}."
+ fetch_file_info(auth_strategy:, drive_id:, item_id:).or do |error|
+ return Failure(error) unless error.code == :not_found && auth_strategy.value!.user.present?
- fetch_file_info_without_user(drive_id, item_id)
+ info "Drive item #{item_id} return 'NotFound'. Sending request as application to verify existence."
+ fetch_file_info_without_user(drive_id, item_id)
+ end
end
end