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
88b7e697
Commit
88b7e697
authored
Jun 11, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address backend maintainer comments
parent
531fc3a1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
10 deletions
+4
-10
app/controllers/import/base_controller.rb
app/controllers/import/base_controller.rb
+0
-4
app/controllers/import/bitbucket_controller.rb
app/controllers/import/bitbucket_controller.rb
+1
-1
app/controllers/import/bitbucket_server_controller.rb
app/controllers/import/bitbucket_server_controller.rb
+1
-3
app/controllers/import/fogbugz_controller.rb
app/controllers/import/fogbugz_controller.rb
+1
-1
app/controllers/import/gitlab_controller.rb
app/controllers/import/gitlab_controller.rb
+1
-1
No files found.
app/controllers/import/base_controller.rb
View file @
88b7e697
...
...
@@ -77,10 +77,6 @@ class Import::BaseController < ApplicationController
NamespaceSerializer
.
new
.
represent
(
namespaces
)
end
def
already_added_project_names
@already_added_projects_names
||=
already_added_projects
.
pluck
(
:import_source
)
# rubocop:disable CodeReuse/ActiveRecord
end
def
namespaces
current_user
.
manageable_groups_with_routes
end
...
...
app/controllers/import/bitbucket_controller.rb
View file @
88b7e697
...
...
@@ -80,7 +80,7 @@ class Import::BitbucketController < Import::BaseController
# rubocop: disable CodeReuse/ActiveRecord
override
:importable_repos
def
importable_repos
already_added_projects_names
=
already_added_projects
.
pluck
(
:import_source
)
already_added_projects_names
=
already_added_projects
.
map
(
&
:import_source
)
bitbucket_repos
.
reject
{
|
repo
|
(
already_added_projects_names
.
include?
repo
.
full_name
)
||
!
repo
.
valid?
}
end
...
...
app/controllers/import/bitbucket_server_controller.rb
View file @
88b7e697
...
...
@@ -49,8 +49,6 @@ class Import::BitbucketServerController < Import::BaseController
else
render
json:
{
errors:
_
(
'This namespace has already been taken! Please choose another one.'
)
},
status: :unprocessable_entity
end
rescue
BitbucketServer
::
Connection
::
ConnectionError
=>
error
render
json:
{
errors:
_
(
"Unable to connect to server: %{error}"
)
%
{
error:
error
}
},
status: :unprocessable_entity
end
def
configure
...
...
@@ -91,7 +89,7 @@ class Import::BitbucketServerController < Import::BaseController
def
importable_repos
# Use the import URL to filter beyond what BaseService#find_already_added_projects
already_added_projects
=
filter_added_projects
(
'bitbucket_server'
,
bitbucket_repos
.
map
(
&
:browse_url
))
already_added_projects_names
=
already_added_projects
.
pluck
(
:import_source
)
already_added_projects_names
=
already_added_projects
.
map
(
&
:import_source
)
bitbucket_repos
.
reject
{
|
repo
|
already_added_projects_names
.
include?
(
repo
.
browse_url
)
||
!
repo
.
valid?
}
end
...
...
app/controllers/import/fogbugz_controller.rb
View file @
88b7e697
...
...
@@ -90,7 +90,7 @@ class Import::FogbugzController < Import::BaseController
def
importable_repos
repos
=
client
.
repos
already_added_projects_names
=
already_added_projects
.
pluck
(
:import_source
)
already_added_projects_names
=
already_added_projects
.
map
(
&
:import_source
)
repos
.
reject
{
|
repo
|
already_added_projects_names
.
include?
repo
.
name
}
end
...
...
app/controllers/import/gitlab_controller.rb
View file @
88b7e697
...
...
@@ -57,7 +57,7 @@ class Import::GitlabController < Import::BaseController
def
importable_repos
repos
=
client
.
projects
(
starting_page:
1
,
page_limit:
MAX_PROJECT_PAGES
,
per_page:
PER_PAGE_PROJECTS
)
already_added_projects_names
=
already_added_projects
.
pluck
(
:import_source
)
already_added_projects_names
=
already_added_projects
.
map
(
&
:import_source
)
repos
.
reject
{
|
repo
|
already_added_projects_names
.
include?
repo
[
"path_with_namespace"
]
}
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