Commit b485b2fa authored by Rémy Coutable's avatar Rémy Coutable

Make use of BaseServiceUtility in project services

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 5efd13bb
...@@ -12,6 +12,8 @@ module Projects ...@@ -12,6 +12,8 @@ module Projects
# #
# Projects::AfterRenameService.new(project).execute # Projects::AfterRenameService.new(project).execute
class AfterRenameService class AfterRenameService
include BaseServiceUtility
# @return [String] The Project being renamed. # @return [String] The Project being renamed.
attr_reader :project attr_reader :project
...@@ -78,7 +80,7 @@ module Projects ...@@ -78,7 +80,7 @@ module Projects
def execute_system_hooks def execute_system_hooks
project.old_path_with_namespace = full_path_before project.old_path_with_namespace = full_path_before
SystemHooksService.new.execute_hooks_for(project, :rename) system_hook_service.execute_hooks_for(project, :rename)
end end
def update_repository_configuration def update_repository_configuration
...@@ -110,7 +112,7 @@ module Projects ...@@ -110,7 +112,7 @@ module Projects
end end
def log_completion def log_completion
Gitlab::AppLogger.info( log_info(
"Project #{project.id} has been renamed from " \ "Project #{project.id} has been renamed from " \
"#{full_path_before} to #{full_path_after}" "#{full_path_before} to #{full_path_after}"
) )
...@@ -140,7 +142,7 @@ module Projects ...@@ -140,7 +142,7 @@ module Projects
def rename_failed! def rename_failed!
error = "Repository #{full_path_before} could not be renamed to #{full_path_after}" error = "Repository #{full_path_before} could not be renamed to #{full_path_after}"
Gitlab::AppLogger.error(error) log_error(error)
raise RenameFailedError, error raise RenameFailedError, error
end end
......
...@@ -187,7 +187,7 @@ module Projects ...@@ -187,7 +187,7 @@ module Projects
end end
def execute_system_hooks def execute_system_hooks
SystemHooksService.new.execute_hooks_for(project, :transfer) system_hook_service.execute_hooks_for(project, :transfer)
end end
def move_project_folders(project) def move_project_folders(project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment