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

Rename Snitch

Marcello Rochabdbd24f5ddff
diff --git a/modules/storages/app/common/storages/injector.rb b/modules/storages/app/common/storages/injector.rb
index 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 Storages
diff --git a/modules/storages/app/common/storages/peripherals/managed_folder_identifier/nextcloud.rb b/modules/storages/app/common/storages/peripherals/managed_folder_identifier/nextcloud.rb
index 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 Storages
diff --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.rb
index 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 Storages
diff --git a/modules/storages/app/common/storages/peripherals/registry.rb b/modules/storages/app/common/storages/peripherals/registry.rb
index 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 Storages
extend Dry::Container::Mixin
class Resolver < Dry::Container::Resolver
- include Snitch
+ include TaggedLogging
def call(container, key)
with_tagged_logger("Registry") do
info "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.rb
index 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 Storages
module StorageInteraction
module Nextcloud
class AddUserToGroupCommand
- include Snitch
+ include TaggedLogging
def initialize(storage)
@storage = storage
diff --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.rb
index 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 Storages
module StorageInteraction
module Nextcloud
class FileIdsQuery
- include Snitch
+ include TaggedLogging
def self.call(storage:, path:)
new(storage).call(path:)
end
diff --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.rb
index 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 Storages
module StorageInteraction
module Nextcloud
class GroupUsersQuery
- include Snitch
+ include TaggedLogging
using ServiceResultRefinements
def 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.rb
index 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 Storages
module Nextcloud
module Internal
class PropfindQueryLegacy
- include Snitch
+ include TaggedLogging
def self.call(storage:, depth:, path:, props:)
new(storage).call(depth:, path:, props:)
end
diff --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.rb
index 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 Storages
module StorageInteraction
module Nextcloud
class RemoveUserFromGroupCommand
- include Snitch
+ include TaggedLogging
def self.call(storage:, user:, group: storage.group)
new(storage).call(user:, group:)
end
diff --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.rb
index 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 Storages
module StorageInteraction
module Nextcloud
class RenameFileCommand
- include Snitch
+ include TaggedLogging
def 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.rb
index 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 Storages
module StorageInteraction
module Nextcloud
class SetPermissionsCommand
- include Snitch
+ include TaggedLogging
using ServiceResultRefinements
SUCCESS_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.rb
index 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 Storages
module Peripherals
module StorageInteraction
diff --git a/modules/storages/app/common/storages/snitch.rb b/modules/storages/app/common/storages/snitch.rb
deleted file mode 100644
index 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
-end
diff --git a/modules/storages/app/common/storages/tagged_logging.rb b/modules/storages/app/common/storages/tagged_logging.rb
new file mode 100644
index 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
+end
diff --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.rb
index 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 Storages
class NextcloudGroupFolderPropertiesSyncService
extend ActiveModel::Naming
extend ActiveModel::Translation
- include Snitch
+ include TaggedLogging
using Peripherals::ServiceResultRefinements