From 60053c12014db906afdc481638de9f746e663a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 21 Sep 2017 15:29:36 +0200 Subject: Fetch 100 results when calling the GitHub API in Github::Import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- lib/github/import.rb | 12 ++++++------ 1 file 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) -- cgit v1.2.1