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
4a514b27
Commit
4a514b27
authored
Apr 14, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_15155' into 'master'
Setup visibility level for project when transfering for a group fixes #15155 See merge request !3707
parents
39f6cfcc
a8ea2c18
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
CHANGELOG
CHANGELOG
+1
-0
transfer_service.rb
app/services/projects/transfer_service.rb
+3
-2
edit.html.haml
app/views/projects/edit.html.haml
+1
-0
transfer_service_spec.rb
spec/services/projects/transfer_service_spec.rb
+23
-0
No files found.
CHANGELOG
View file @
4a514b27
...
...
@@ -10,6 +10,7 @@ v 8.7.0 (unreleased)
- All images in discussions and wikis now link to their source files !3464 (Connor Shea).
- Return status code 303 after a branch DELETE operation to avoid project deletion (Stan Hu)
- Add setting for customizing the list of trusted proxies !3524
- Allow projects to be transfered to a lower visibility level group
- Fix `signed_in_ip` being set to 127.0.0.1 when using a reverse proxy !3524
- Improved Markdown rendering performance !3389 (Yorick Peterse)
- Don't attempt to look up an avatar in repo if repo directory does not exist (Stan Hu)
...
...
app/services/projects/transfer_service.rb
View file @
4a514b27
...
...
@@ -34,8 +34,9 @@ module Projects
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
end
# Apply new namespace id
# Apply new namespace id
and visibility level
project
.
namespace
=
new_namespace
project
.
visibility_level
=
new_namespace
.
visibility_level
unless
project
.
visibility_level_allowed_by_group?
project
.
save!
# Notifications
...
...
@@ -56,7 +57,7 @@ module Projects
Gitlab
::
UploadsTransfer
.
new
.
move_project
(
project
.
path
,
old_namespace
.
path
,
new_namespace
.
path
)
project
.
old_path_with_namespace
=
old_path
SystemHooksService
.
new
.
execute_hooks_for
(
project
,
:transfer
)
true
end
...
...
app/views/projects/edit.html.haml
View file @
4a514b27
...
...
@@ -210,6 +210,7 @@
%li
Be careful. Changing the project's namespace can have unintended side effects.
%li
You can only transfer the project to namespaces you manage.
%li
You will need to update your local repositories to point to the new location.
%li
Project visibility level will be changed to match namespace rules when transfering to a group.
.form-actions
=
f
.
submit
'Transfer project'
,
class:
"btn btn-remove js-confirm-danger"
,
data:
{
"confirm-danger-message"
=>
transfer_project_message
(
@project
)
}
-
else
...
...
spec/services/projects/transfer_service_spec.rb
View file @
4a514b27
...
...
@@ -38,4 +38,27 @@ describe Projects::TransferService, services: true do
def
transfer_project
(
project
,
user
,
new_namespace
)
Projects
::
TransferService
.
new
(
project
,
user
).
execute
(
new_namespace
)
end
context
'visibility level'
do
let
(
:internal_group
)
{
create
(
:group
,
:internal
)
}
before
{
internal_group
.
add_owner
(
user
)
}
context
'when namespace visibility level < project visibility level'
do
let
(
:public_project
)
{
create
(
:project
,
:public
,
namespace:
user
.
namespace
)
}
before
{
transfer_project
(
public_project
,
user
,
internal_group
)
}
it
{
expect
(
public_project
.
visibility_level
).
to
eq
(
internal_group
.
visibility_level
)
}
end
context
'when namespace visibility level > project visibility level'
do
let
(
:private_project
)
{
create
(
:project
,
:private
,
namespace:
user
.
namespace
)
}
before
{
transfer_project
(
private_project
,
user
,
internal_group
)
}
it
{
expect
(
private_project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
}
end
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