BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
990af894
Commit
990af894
authored
Jul 23, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve project rename log messages for better debugging
Helping to diagnose #20178
parent
46a17ffd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
project.rb
app/models/project.rb
+10
-1
No files found.
app/models/project.rb
View file @
990af894
...
...
@@ -882,9 +882,13 @@ class Project < ActiveRecord::Base
old_path_with_namespace
=
File
.
join
(
namespace_dir
,
path_was
)
new_path_with_namespace
=
File
.
join
(
namespace_dir
,
path
)
Rails
.
logger
.
error
"Attempting to rename
#{
old_path_with_namespace
}
->
#{
new_path_with_namespace
}
"
expire_caches_before_rename
(
old_path_with_namespace
)
if
has_container_registry_tags?
Rails
.
logger
.
error
"Project
#{
old_path_with_namespace
}
cannot be renamed because container registry tags are present"
# we currently doesn't support renaming repository if it contains tags in container registry
raise
Exception
.
new
(
'Project cannot be renamed, because tags are present in its container registry'
)
end
...
...
@@ -903,17 +907,22 @@ class Project < ActiveRecord::Base
SystemHooksService
.
new
.
execute_hooks_for
(
self
,
:rename
)
@repository
=
nil
rescue
rescue
=>
e
Rails
.
logger
.
error
"Exception renaming
#{
old_path_with_namespace
}
->
#{
new_path_with_namespace
}
:
#{
e
}
"
# Returning false does not rollback after_* transaction but gives
# us information about failing some of tasks
false
end
else
Rails
.
logger
.
error
"Repository could not be renamed:
#{
old_path_with_namespace
}
->
#{
new_path_with_namespace
}
"
# if we cannot move namespace directory we should rollback
# db changes in order to prevent out of sync between db and fs
raise
Exception
.
new
(
'repository cannot be renamed'
)
end
Gitlab
::
AppLogger
.
info
"Project was renamed:
#{
old_path_with_namespace
}
->
#{
new_path_with_namespace
}
"
Gitlab
::
UploadsTransfer
.
new
.
rename_project
(
path_was
,
path
,
namespace
.
path
)
end
...
...
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