GitHub: use files API with pagination #1440
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Switched from using the GitHub API Get a pull request to the List pull requests files API, incorporating pagination to retrieve pull request diffs. This change enables the analysis of pull requests containing more than 300 files.
Although the 300 file limit on the "Get a pull request" API isn't new, GitHub recently began enforcing it with a HTTP 406 status code. Currently, Danger is failing when analyzing pull requests exceeding this limit.
The "List pull requests files" API returns a slightly different git diff format, omitting the initial
diff --git …
part whichparse-diff
expects. As a hack, I'm adding it manually now.Happy to hear your feedback on this approach :)
Fixes #1432 and danger/swift#606