Implement infinite scroll pagination for importers
What does this MR do?
This MR implements infinite scroll instead of pagination for all our importers
See #235708 (comment 399704877) for details
Please, take a note that this MR only introduces infinite scroll, no other changes (like moving "in progress" projects to the to are being made)
Testing
docker run --name="bitbucket" --rm -d -p 7990:7990 -p 7999:7999 atlassian/bitbucket-server
- Go to
http://localhost:7999
and set up trial bitbucket server with loginadmin
and passwordadmin
(you will need atlassian account) - Run the following script
#!/bin/bash
bb_user=admin
bb_pswd=admin
bb_host=http://localhost:7990
bb_projects_count=30
bb_repos_count=3
for project in `cat /dev/urandom | tr -dc 'A-Z' | fold -w 5 | head -n $bb_projects_count`; do
echo -e "* creating project $project \n"
curl -s -u $bb_user:$bb_pswd -X POST -H "Content-Type: application/json" $bb_host/rest/api/latest/projects -d '{"key": "'$project'", "name": "my project '$project'", "description": "API generated project '$project'"}'
for slug in `cat /dev/urandom | tr -dc 'a-z' | fold -w 10 | head -n $bb_repos_count`; do
echo -e " * creating repo $slug under the project $project \n"
curl -s -u $bb_user:$bb_pswd -X POST -H "Content-Type: application/json" -d '{"name": "'$slug'", "scmID": "git", "forkable":false}' $bb_host/rest/api/latest/projects/$project/repos
done
done
- Apply following patch to your gitlab codebase to allow connects to localhost
diff --git a/lib/gitlab/url_blocker.rb b/lib/gitlab/url_blocker.rb
index 9213b5ebab2..35a63d27eb2 100644
--- a/lib/gitlab/url_blocker.rb
+++ b/lib/gitlab/url_blocker.rb
@@ -210,6 +210,8 @@ module Gitlab
end
def validate_localhost(addrs_info)
+ return
+
local_ips = ["::", "0.0.0.0"]
local_ips.concat(Socket.ip_address_list.map(&:ip_address))
@@ -219,12 +221,16 @@ module Gitlab
end
def validate_loopback(addrs_info)
+ return
+
return unless addrs_info.any? { |addr| addr.ipv4_loopback? || addr.ipv6_loopback? }
raise BlockedUrlError, "Requests to loopback addresses are not allowed"
end
def validate_local_network(addrs_info)
+ return
+
return unless addrs_info.any? { |addr| addr.ipv4_private? || addr.ipv6_sitelocal? || addr.ipv6_unique_local? }
raise BlockedUrlError, "Requests to the local network are not allowed"
- Go to
Projects > New > Import
and initiate import from bitbucket server using loginadmin
, passwordadmin
and hosthttp://localhost:7990
Video
Bitbucket_Server_Import___GitLab__1_
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Illya Klymov