-
Notifications
You must be signed in to change notification settings - Fork 769
Description
Describe the bug
https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit
Note: If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.
Except hub4j doesn't support pagination at this time:
github-api/src/main/java/org/kohsuke/github/GHCommit.java
Lines 418 to 421 in 9801b86
| public List<File> getFiles() throws IOException { | |
| populate(); | |
| return files != null ? Collections.unmodifiableList(files) : Collections.<File>emptyList(); | |
| } |
To Reproduce
Steps to reproduce the behavior:
- Use
GHCommit.getFiles()on a commit with more than 300 files changed.
Expected behavior
Suggest deprecating getFiles() and adding a listFile() that returns a PagedIterable. However, I think that PagedIterable will need to be backed by a custom class similar to GHWorkflowsIterable with the GHCommit as the container. It's going to take some trial-and-error to figure out how this works.