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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
e9d5e95c
Commit
e9d5e95c
authored
7 years ago
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert changes in services related to moving projects
parent
a9b221d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/models/namespace.rb
app/models/namespace.rb
+1
-1
app/models/project.rb
app/models/project.rb
+2
-2
app/services/projects/transfer_service.rb
app/services/projects/transfer_service.rb
+2
-2
No files found.
app/models/namespace.rb
View file @
e9d5e95c
...
@@ -150,7 +150,7 @@ class Namespace < ActiveRecord::Base
...
@@ -150,7 +150,7 @@ class Namespace < ActiveRecord::Base
end
end
def
any_project_has_container_registry_images?
def
any_project_has_container_registry_images?
projects
.
joins
(
:container_repositories
).
any?
projects
.
any?
(
&
:has_container_registry_tags?
)
end
end
def
send_update_instructions
def
send_update_instructions
...
...
This diff is collapsed.
Click to expand it.
app/models/project.rb
View file @
e9d5e95c
...
@@ -894,8 +894,8 @@ class Project < ActiveRecord::Base
...
@@ -894,8 +894,8 @@ class Project < ActiveRecord::Base
expire_caches_before_rename
(
old_path_with_namespace
)
expire_caches_before_rename
(
old_path_with_namespace
)
if
container_repositories
.
present
?
if
has_container_registry_tags
?
Rails
.
logger
.
error
"Project
#{
old_path_with_namespace
}
cannot be renamed because container registry
images are present
"
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 images in container registry
# we currently doesn't support renaming repository if it contains images in container registry
raise
StandardError
.
new
(
'Project cannot be renamed, because images are present in its container registry'
)
raise
StandardError
.
new
(
'Project cannot be renamed, because images are present in its container registry'
)
...
...
This diff is collapsed.
Click to expand it.
app/services/projects/transfer_service.rb
View file @
e9d5e95c
...
@@ -36,9 +36,9 @@ module Projects
...
@@ -36,9 +36,9 @@ module Projects
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
end
end
unless
project
.
container_repositories
.
empty
?
if
project
.
has_container_registry_tags
?
# we currently doesn't support renaming repository if it contains images in container registry
# we currently doesn't support renaming repository if it contains images in container registry
raise
TransferError
.
new
(
'Project cannot be transferred, because
image
s are present in its container registry'
)
raise
TransferError
.
new
(
'Project cannot be transferred, because
tag
s are present in its container registry'
)
end
end
project
.
expire_caches_before_rename
(
old_path
)
project
.
expire_caches_before_rename
(
old_path
)
...
...
This diff is collapsed.
Click to expand it.
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