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
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
app/models/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
...
@@ -882,9 +882,13 @@ class Project < ActiveRecord::Base
old_path_with_namespace
=
File
.
join
(
namespace_dir
,
path_was
)
old_path_with_namespace
=
File
.
join
(
namespace_dir
,
path_was
)
new_path_with_namespace
=
File
.
join
(
namespace_dir
,
path
)
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
)
expire_caches_before_rename
(
old_path_with_namespace
)
if
has_container_registry_tags?
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
# 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'
)
raise
Exception
.
new
(
'Project cannot be renamed, because tags are present in its container registry'
)
end
end
...
@@ -903,17 +907,22 @@ class Project < ActiveRecord::Base
...
@@ -903,17 +907,22 @@ class Project < ActiveRecord::Base
SystemHooksService
.
new
.
execute_hooks_for
(
self
,
:rename
)
SystemHooksService
.
new
.
execute_hooks_for
(
self
,
:rename
)
@repository
=
nil
@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
# Returning false does not rollback after_* transaction but gives
# us information about failing some of tasks
# us information about failing some of tasks
false
false
end
end
else
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
# if we cannot move namespace directory we should rollback
# db changes in order to prevent out of sync between db and fs
# db changes in order to prevent out of sync between db and fs
raise
Exception
.
new
(
'repository cannot be renamed'
)
raise
Exception
.
new
(
'repository cannot be renamed'
)
end
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
)
Gitlab
::
UploadsTransfer
.
new
.
rename_project
(
path_was
,
path
,
namespace
.
path
)
end
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