From 0efe1d7a84979dc019b3e8bbf5f2eb15944b4672 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 30 Oct 2019 13:22:55 +0100 Subject: [PATCH] #129 - Collect GitHub issues with pagination. --- .../data/release/issues/github/GitHub.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/release/issues/github/GitHub.java b/src/main/java/org/springframework/data/release/issues/github/GitHub.java index 18f6f16..7ea69e6 100644 --- a/src/main/java/org/springframework/data/release/issues/github/GitHub.java +++ b/src/main/java/org/springframework/data/release/issues/github/GitHub.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2014-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -519,9 +519,14 @@ class GitHub implements IssueTracker { private Stream getForIssues(String template, Map parameters) { - return operations - .exchange(template, HttpMethod.GET, new HttpEntity<>(newUserScopedHttpHeaders()), ISSUES_TYPE, parameters) - .getBody().stream(); + List issues = new ArrayList<>(); + doWithPaging(template, HttpMethod.GET, parameters, new HttpEntity<>(newUserScopedHttpHeaders()), ISSUES_TYPE, + tickets -> { + issues.addAll(tickets); + return true; + }); + + return issues.stream(); } private Milestone getMilestone(ModuleIteration moduleIteration, String repositoryName) {