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
515097b3
Commit
515097b3
authored
Jul 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
4a070137
bccd61b5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
0 deletions
+61
-0
changelogs/unreleased/georgekoltsov-64311-set-visibility-private-if-internal-restricted.yml
...v-64311-set-visibility-private-if-internal-restricted.yml
+5
-0
doc/development/README.md
doc/development/README.md
+1
-0
doc/development/interacting_components.md
doc/development/interacting_components.md
+29
-0
doc/user/project/settings/import_export.md
doc/user/project/settings/import_export.md
+5
-0
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+1
-0
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+20
-0
No files found.
changelogs/unreleased/georgekoltsov-64311-set-visibility-private-if-internal-restricted.yml
0 → 100644
View file @
515097b3
---
title
:
Set visibility level 'Private' for restricted 'Internal' imported projects when 'Internal' visibility setting is restricted in admin settings
merge_request
:
30522
author
:
type
:
other
doc/development/README.md
View file @
515097b3
...
...
@@ -63,6 +63,7 @@ description: 'Learn how to contribute to GitLab.'
-
[
Routing
](
routing.md
)
-
[
Repository mirroring
](
repository_mirroring.md
)
-
[
Git LFS
](
lfs.md
)
-
[
Developing against interacting components or features
](
interacting_components.md
)
## Performance guides
...
...
doc/development/interacting_components.md
0 → 100644
View file @
515097b3
# Developing against interacting components or features
It's not uncommon that a single code change can reflect and interact with multiple parts of GitLab
codebase. Furthermore, an existing feature might have an underlying integration or behavior that
might go unnoticed even by reviewers and maintainers.
The goal of this section is to briefly list interacting pieces to think about
when making _backend_ changes that might involve multiple features or
[
components
](
architecture.md#components
)
.
## Uploads
GitLab supports uploads to [object storage]. That means every feature and
change that affects uploads should also be tested against [object storage],
which is _not_ enabled by default in
[
GDK
](
https://gitlab.com/gitlab-org/gitlab-development-kit
)
.
When working on a related feature, make sure to enable and test it
against
[
Minio
](
https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/object_storage.md
)
.
See also
[
File Storage in GitLab
](
file_storage.md
)
.
## Merge requests
### Forks
GitLab supports a great amount of features for
[
merge requests
](
../user/project/merge_requests/index.md
)
. One
of them is the ability to create merge requests from and to
[
forks
](
../gitlab-basics/fork-project.md
)
,
which should also be highly considered and tested upon development phase.
[
object storage
]:
https://docs.gitlab.com/charts/advanced/external-object-storage/
doc/user/project/settings/import_export.md
View file @
515097b3
...
...
@@ -116,3 +116,8 @@ For more details on the specific data persisted in a project export, see the
1.
Click on
**Import project**
to begin importing. Your newly imported project
page will appear soon.
NOTE:
**Note:**
If use of the
`Internal`
visibility level
[
is restricted
](
../../../public_access/public_access.md#restricting-the-use-of-public-or-internal-projects
)
,
all imported projects are given the visibility of
`Private`
.
lib/gitlab/import_export/project_tree_restorer.rb
View file @
515097b3
...
...
@@ -130,6 +130,7 @@ module Gitlab
def
visibility_level
level
=
override_params
[
'visibility_level'
]
||
json_params
[
'visibility_level'
]
||
@project
.
visibility_level
level
=
@project
.
group
.
visibility_level
if
@project
.
group
&&
level
.
to_i
>
@project
.
group
.
visibility_level
level
=
Gitlab
::
VisibilityLevel
::
PRIVATE
if
level
==
Gitlab
::
VisibilityLevel
::
INTERNAL
&&
Gitlab
::
CurrentSettings
.
restricted_visibility_levels
.
include?
(
level
)
{
'visibility_level'
=>
level
}
end
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
515097b3
...
...
@@ -496,6 +496,18 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
end
context
'with restricted internal visibility'
do
describe
'internal project'
do
let
(
:visibility
)
{
Gitlab
::
VisibilityLevel
::
INTERNAL
}
it
'uses private visibility'
do
stub_application_setting
(
restricted_visibility_levels:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
])
expect
(
restorer
.
restored_project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
end
end
context
'with group visibility'
do
before
do
group
=
create
(
:group
,
visibility_level:
group_visibility
)
...
...
@@ -528,6 +540,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
it
'uses the group visibility'
do
expect
(
restorer
.
restored_project
.
visibility_level
).
to
eq
(
group_visibility
)
end
context
'with restricted internal visibility'
do
it
'sets private visibility'
do
stub_application_setting
(
restricted_visibility_levels:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
])
expect
(
restorer
.
restored_project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
end
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