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
b77cfa78
Commit
b77cfa78
authored
Apr 10, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
4580824f
e861af40
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
changelogs/unreleased/47327-fix-github-import-visibility.yml
changelogs/unreleased/47327-fix-github-import-visibility.yml
+5
-0
lib/gitlab/legacy_github_import/project_creator.rb
lib/gitlab/legacy_github_import/project_creator.rb
+1
-1
spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
+13
-3
No files found.
changelogs/unreleased/47327-fix-github-import-visibility.yml
0 → 100644
View file @
b77cfa78
---
title
:
Fix GitHub project import visibility
merge_request
:
27133
author
:
Daniel Wyatt
type
:
fixed
lib/gitlab/legacy_github_import/project_creator.rb
View file @
b77cfa78
...
...
@@ -37,7 +37,7 @@ module Gitlab
end
def
visibility_level
visibility_level
=
repo
.
private
?
Gitlab
::
VisibilityLevel
::
PRIVATE
:
Gitlab
::
VisibilityLevel
::
PUBLIC
visibility_level
=
repo
.
private
?
Gitlab
::
VisibilityLevel
::
PRIVATE
:
@namespace
.
visibility_level
visibility_level
=
Gitlab
::
CurrentSettings
.
default_project_visibility
if
Gitlab
::
CurrentSettings
.
restricted_visibility_levels
.
include?
(
visibility_level
)
visibility_level
...
...
spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
View file @
b77cfa78
...
...
@@ -47,12 +47,22 @@ describe Gitlab::LegacyGithubImport::ProjectCreator do
end
context
'when GitHub project is public'
do
it
'sets project visibility to
public
'
do
it
'sets project visibility to
namespace visibility level
'
do
repo
.
private
=
false
project
=
service
.
execute
expect
(
project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PUBLIC
)
expect
(
project
.
visibility_level
).
to
eq
(
namespace
.
visibility_level
)
end
context
'when importing into a user namespace'
do
subject
(
:service
)
{
described_class
.
new
(
repo
,
repo
.
name
,
user
.
namespace
,
user
,
github_access_token:
'asdffg'
)
}
it
'sets project visibility to user namespace visibility level'
do
repo
.
private
=
false
project
=
service
.
execute
expect
(
project
.
visibility_level
).
to
eq
(
user
.
namespace
.
visibility_level
)
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