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
Rename Snitch
Marcello Rochabdbd24f5ddff
diff --git a/modules/storages/app/common/storages/injector.rb b/modules/storages/app/common/storages/injector.rbindex d8d5b6dce41..44cc4c6ce32 100644--- a/modules/storages/app/common/storages/injector.rb+++ b/modules/storages/app/common/storages/injector.rb@@ -1,5 +1,33 @@# frozen_string_literal: true+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 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 "dry/auto_inject"module Storagesdiff --git a/modules/storages/app/common/storages/peripherals/managed_folder_identifier/nextcloud.rb b/modules/storages/app/common/storages/peripherals/managed_folder_identifier/nextcloud.rbindex 5ca9c05ecb4..fe422b89e30 100644--- a/modules/storages/app/common/storages/peripherals/managed_folder_identifier/nextcloud.rb+++ b/modules/storages/app/common/storages/peripherals/managed_folder_identifier/nextcloud.rb@@ -1,6 +1,31 @@# frozen_string_literal: true#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 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 Storagesdiff --git a/modules/storages/app/common/storages/peripherals/managed_folder_identifier/one_drive.rb b/modules/storages/app/common/storages/peripherals/managed_folder_identifier/one_drive.rbindex e81c3ac99e1..166b4ea6b59 100644--- a/modules/storages/app/common/storages/peripherals/managed_folder_identifier/one_drive.rb+++ b/modules/storages/app/common/storages/peripherals/managed_folder_identifier/one_drive.rb@@ -1,6 +1,31 @@# frozen_string_literal: true#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 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 Storagesdiff --git a/modules/storages/app/common/storages/peripherals/registry.rb b/modules/storages/app/common/storages/peripherals/registry.rbindex dc91fbfd13f..cd2b1e072af 100644--- a/modules/storages/app/common/storages/peripherals/registry.rb+++ b/modules/storages/app/common/storages/peripherals/registry.rb@@ -36,7 +36,7 @@ module Storagesextend Dry::Container::Mixinclass Resolver < Dry::Container::Resolver- include Snitch+ include TaggedLoggingdef call(container, key)with_tagged_logger("Registry") doinfo "Resolving #{key}"diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rbindex 7289dcf4da6..cdd87d06f2b 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb@@ -33,7 +33,7 @@ module Storagesmodule StorageInteractionmodule Nextcloudclass AddUserToGroupCommand- include Snitch+ include TaggedLoggingdef initialize(storage)@storage = storagediff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rbindex 8b5e3c60868..8e5a3ae2e76 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rb@@ -33,7 +33,7 @@ module Storagesmodule StorageInteractionmodule Nextcloudclass FileIdsQuery- include Snitch+ include TaggedLoggingdef self.call(storage:, path:)new(storage).call(path:)enddiff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rbindex d97c2acf4c7..edd47508fc5 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rb@@ -33,7 +33,7 @@ module Storagesmodule StorageInteractionmodule Nextcloudclass GroupUsersQuery- include Snitch+ include TaggedLoggingusing ServiceResultRefinementsdef self.call(storage:, group: storage.group)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/propfind_query_legacy.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/propfind_query_legacy.rbindex 6b04c969db0..9e30b2fd653 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/propfind_query_legacy.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/propfind_query_legacy.rb@@ -34,7 +34,7 @@ module Storagesmodule Nextcloudmodule Internalclass PropfindQueryLegacy- include Snitch+ include TaggedLoggingdef self.call(storage:, depth:, path:, props:)new(storage).call(depth:, path:, props:)enddiff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rbindex 623e8f5eb1d..032f49aac7b 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb@@ -33,7 +33,7 @@ module Storagesmodule StorageInteractionmodule Nextcloudclass RemoveUserFromGroupCommand- include Snitch+ include TaggedLoggingdef self.call(storage:, user:, group: storage.group)new(storage).call(user:, group:)enddiff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rbindex aa0f6e1ef15..95b686d1860 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rb@@ -33,7 +33,7 @@ module Storagesmodule StorageInteractionmodule Nextcloudclass RenameFileCommand- include Snitch+ include TaggedLoggingdef self.call(storage:, auth_strategy:, file_id:, name:)new(storage).call(auth_strategy:, file_id:, name:)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rbindex 8c3754f6f1b..ed0c5b4d82b 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb@@ -33,7 +33,7 @@ module Storagesmodule StorageInteractionmodule Nextcloudclass SetPermissionsCommand- include Snitch+ include TaggedLoggingusing ServiceResultRefinementsSUCCESS_XPATH = "/d:multistatus/d:response/d:propstat[d:status[text() = 'HTTP/1.1 200 OK']]/d:prop/nc:acl-list"diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/result_data/copy_template_folder.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/result_data/copy_template_folder.rbindex efacc4cb360..61369c34b3c 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/result_data/copy_template_folder.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/result_data/copy_template_folder.rb@@ -1,3 +1,33 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 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 Storagesmodule Peripheralsmodule StorageInteractiondiff --git a/modules/storages/app/common/storages/snitch.rb b/modules/storages/app/common/storages/snitch.rbdeleted file mode 100644index 536f66e53a2..00000000000--- a/modules/storages/app/common/storages/snitch.rb+++ /dev/null@@ -1,18 +0,0 @@-# frozen_string_literal: true--#-- copyright-#++--module Storages- module Snitch- delegate :info, :error, to: :logger-- def with_tagged_logger(tag = self.class, &)- logger.tagged(*tag, &)- end-- def logger- Rails.logger- end- end-enddiff --git a/modules/storages/app/common/storages/tagged_logging.rb b/modules/storages/app/common/storages/tagged_logging.rbnew file mode 100644index 00000000000..35d04a03fd9--- /dev/null+++ b/modules/storages/app/common/storages/tagged_logging.rb@@ -0,0 +1,43 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 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+ module TaggedLogging+ delegate :info, :error, to: :logger++ def with_tagged_logger(tag = self.class, &)+ logger.tagged(*tag, &)+ end++ def logger+ Rails.logger+ end+ end+enddiff --git a/modules/storages/app/services/storages/nextcloud_group_folder_properties_sync_service.rb b/modules/storages/app/services/storages/nextcloud_group_folder_properties_sync_service.rbindex e4fde415a7d..c1cafd66329 100644--- a/modules/storages/app/services/storages/nextcloud_group_folder_properties_sync_service.rb+++ b/modules/storages/app/services/storages/nextcloud_group_folder_properties_sync_service.rb@@ -32,7 +32,7 @@ module Storagesclass NextcloudGroupFolderPropertiesSyncServiceextend ActiveModel::Namingextend ActiveModel::Translation- include Snitch+ include TaggedLoggingusing Peripherals::ServiceResultRefinements