Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-09-21 16:29:36 +0300
committerRémy Coutable <remy@rymai.me>2017-09-26 20:17:00 +0300
commit60053c12014db906afdc481638de9f746e663a40 (patch)
treeab67d6d8a7fed3596bc107f823e963670d3bdda3
parent3b2d68d37d39047e25fbe0ae51cafa39f22805f8 (diff)
Fetch 100 results when calling the GitHub API in Github::Import
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--lib/github/import.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb
index 9354e142d3d..3074a9fea0b 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -115,7 +115,7 @@ module Github
url = "/repos/#{repo}/labels"
while url
- response = Github::Client.new(options).get(url)
+ response = Github::Client.new(options).get(url, per_page: 100)
response.body.each do |raw|
begin
@@ -139,7 +139,7 @@ module Github
url = "/repos/#{repo}/milestones"
while url
- response = Github::Client.new(options).get(url, state: :all)
+ response = Github::Client.new(options).get(url, state: :all, per_page: 100)
response.body.each do |raw|
begin
@@ -168,7 +168,7 @@ module Github
url = "/repos/#{repo}/pulls"
while url
- response = Github::Client.new(options).get(url, state: :all, sort: :created, direction: :asc)
+ response = Github::Client.new(options).get(url, state: :all, sort: :created, direction: :asc, per_page: 100)
response.body.each do |raw|
pull_request = Github::Representation::PullRequest.new(raw, options.merge(project: project))
@@ -224,7 +224,7 @@ module Github
url = "/repos/#{repo}/issues"
while url
- response = Github::Client.new(options).get(url, state: :all, sort: :created, direction: :asc)
+ response = Github::Client.new(options).get(url, state: :all, sort: :created, direction: :asc, per_page: 100)
response.body.each { |raw| populate_issue(raw) }
@@ -276,7 +276,7 @@ module Github
def fetch_comments(noteable, type, url, klass = Note)
while url
- comments = Github::Client.new(options).get(url)
+ comments = Github::Client.new(options).get(url, per_page: 100)
ActiveRecord::Base.no_touching do
comments.body.each do |raw|
@@ -308,7 +308,7 @@ module Github
url = "/repos/#{repo}/releases"
while url
- response = Github::Client.new(options).get(url)
+ response = Github::Client.new(options).get(url, per_page: 100)
response.body.each do |raw|
representation = Github::Representation::Release.new(raw)