Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b485b2fa
Commit
b485b2fa
authored
Oct 05, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make use of BaseServiceUtility in project services
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
5efd13bb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
app/services/projects/after_rename_service.rb
app/services/projects/after_rename_service.rb
+5
-3
app/services/projects/transfer_service.rb
app/services/projects/transfer_service.rb
+1
-1
No files found.
app/services/projects/after_rename_service.rb
View file @
b485b2fa
...
@@ -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
...
...
app/services/projects/transfer_service.rb
View file @
b485b2fa
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment