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
2c260962
Commit
2c260962
authored
Aug 01, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactor in LegacyNamespace and moved back send_update_instructions
parent
597e6190
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
legacy_namespace.rb
app/models/concerns/storage/legacy_namespace.rb
+2
-9
namespace.rb
app/models/namespace.rb
+6
-0
No files found.
app/models/concerns/storage/legacy_namespace.rb
View file @
2c260962
...
...
@@ -7,7 +7,7 @@ module Storage
raise
Gitlab
::
UpdatePathError
.
new
(
'Namespace cannot be moved, because at least one project has tags in container registry'
)
end
# Move the namespace directory in all storage
s
paths used by member projects
# Move the namespace directory in all storage paths used by member projects
repository_storage_paths
.
each
do
|
repository_storage_path
|
# Ensure old directory exists before moving it
gitlab_shell
.
add_namespace
(
repository_storage_path
,
full_path_was
)
...
...
@@ -49,12 +49,6 @@ module Storage
private
def
send_update_instructions
projects
.
each
do
|
project
|
project
.
send_move_instructions
(
"
#{
full_path_was
}
/
#{
project
.
path
}
"
)
end
end
def
old_repository_storage_paths
@old_repository_storage_paths
||=
repository_storage_paths
end
...
...
@@ -76,8 +70,7 @@ module Storage
new_path
=
"
#{
full_path
}
+
#{
id
}
+deleted"
if
gitlab_shell
.
mv_namespace
(
repository_storage_path
,
full_path
,
new_path
)
message
=
"Namespace directory
\"
#{
full_path
}
\"
moved to
\"
#{
new_path
}
\"
"
Gitlab
::
AppLogger
.
info
message
Gitlab
::
AppLogger
.
info
%Q(Namespace directory "
#{
full_path
}
" moved to "
#{
new_path
}
")
# Remove namespace directroy async with delay so
# GitLab has time to remove all projects first
...
...
app/models/namespace.rb
View file @
2c260962
...
...
@@ -124,6 +124,12 @@ class Namespace < ActiveRecord::Base
all_projects
.
any?
(
&
:has_container_registry_tags?
)
end
def
send_update_instructions
projects
.
each
do
|
project
|
project
.
send_move_instructions
(
"
#{
full_path_was
}
/
#{
project
.
path
}
"
)
end
end
def
kind
type
==
'Group'
?
'group'
:
'user'
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