coreos / issue-sync

A tool for synchronizing issue tracking between GitHub and JIRA
Apache License 2.0
124 stars 34 forks source link

Add support for GitHub pagination #22

Closed MorganEPatch closed 7 years ago

MorganEPatch commented 7 years ago

Add support for GitHub's pagination feature, and collect all of the issues updated after since.

This creates a loop in the GitHubClient.ListIssues() function, which continues to request more issues as long as there are pages, collecting all of the issues. It also moves the check that issues are not pull requests into the same function.

An issue occurred where the list of GitHub issues was so long that putting all of their IDs into the JQL in JIRAClient.ListIssues() was causing "414 Request-URI Too Long" errors, so if there are too many IDs in the request (currently the line is 100), the function instead requests all issues, and performs the ID filtering itself. Otherwise, it defers to the JIRA client for that for efficiency.

@squat