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
4ad8f12e
Commit
4ad8f12e
authored
Jul 24, 2017
by
Grzegorz Bizon
Committed by
Rémy Coutable
Jul 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix editing project with container images present
parent
d384b6a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
app/services/projects/update_service.rb
app/services/projects/update_service.rb
+8
-1
changelogs/unreleased/fix-gb-project-update-with-registry-images.yml
...unreleased/fix-gb-project-update-with-registry-images.yml
+4
-0
spec/services/projects/update_service_spec.rb
spec/services/projects/update_service_spec.rb
+8
-1
No files found.
app/services/projects/update_service.rb
View file @
4ad8f12e
...
@@ -5,7 +5,7 @@ module Projects
...
@@ -5,7 +5,7 @@ module Projects
return
error
(
'New visibility level not allowed!'
)
return
error
(
'New visibility level not allowed!'
)
end
end
if
project
.
has
_container_registry_tags?
if
renaming_project_with
_container_registry_tags?
return
error
(
'Cannot rename project because it contains container registry tags!'
)
return
error
(
'Cannot rename project because it contains container registry tags!'
)
end
end
...
@@ -44,6 +44,13 @@ module Projects
...
@@ -44,6 +44,13 @@ module Projects
true
true
end
end
def
renaming_project_with_container_registry_tags?
new_path
=
params
[
:path
]
new_path
&&
new_path
!=
project
.
path
&&
project
.
has_container_registry_tags?
end
def
changing_default_branch?
def
changing_default_branch?
new_branch
=
params
[
:default_branch
]
new_branch
=
params
[
:default_branch
]
...
...
changelogs/unreleased/fix-gb-project-update-with-registry-images.yml
0 → 100644
View file @
4ad8f12e
---
title
:
Fix editing project with container images present
merge_request
:
13028
author
:
spec/services/projects/update_service_spec.rb
View file @
4ad8f12e
...
@@ -103,7 +103,7 @@ describe Projects::UpdateService, '#execute', :services do
...
@@ -103,7 +103,7 @@ describe Projects::UpdateService, '#execute', :services do
end
end
end
end
context
'when
renaming
project that contains container images'
do
context
'when
updating a
project that contains container images'
do
before
do
before
do
stub_container_registry_config
(
enabled:
true
)
stub_container_registry_config
(
enabled:
true
)
stub_container_registry_tags
(
repository:
/image/
,
tags:
%w[rc1]
)
stub_container_registry_tags
(
repository:
/image/
,
tags:
%w[rc1]
)
...
@@ -116,6 +116,13 @@ describe Projects::UpdateService, '#execute', :services do
...
@@ -116,6 +116,13 @@ describe Projects::UpdateService, '#execute', :services do
expect
(
result
).
to
include
(
status: :error
)
expect
(
result
).
to
include
(
status: :error
)
expect
(
result
[
:message
]).
to
match
(
/contains container registry tags/
)
expect
(
result
[
:message
]).
to
match
(
/contains container registry tags/
)
end
end
it
'allows to update other settings'
do
result
=
update_project
(
project
,
admin
,
public_builds:
true
)
expect
(
result
[
:status
]).
to
eq
:success
expect
(
project
.
reload
.
public_builds
).
to
be
true
end
end
end
context
'when passing invalid parameters'
do
context
'when passing invalid parameters'
do
...
...
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