RFR: 2122: Minor bot optimizations for GitHub API

Erik Joelsson erikj at openjdk.org
Tue Dec 19 13:29:32 UTC 2023


On Sun, 17 Dec 2023 23:26:29 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> I've made some minor optimizations to some GitHub interactions that I would like to integrate. They don't make a big impact on their own, but are part of a bigger effort to reduce latency in certain bots. The idea is to reduce the number of individual calls when possible, as we are limiting calls for rate limits through global locks. We spend a lot of time waiting on those locks, so reducing the number of calls can be valuable.
>> 
>> When listing ReviewComments on GitHub, we need to fetch commit data in order to correctly generate all the file and line data for the comment. However, in most cases we don't actually need this data. I propose implementing an alternate method on PullRequest to retrieve ReviewComments as a list of regular Comment objects, without the file and line data.
>> 
>> When listing comments of various kinds, we are often hitting pagination. The default page size on GitHub is usually 30 with 100 being the max. Our methods for listing comments always fetch all of them, so it would make sense to use the max page size to reduce the number of individual calls.
>
> forge/src/main/java/org/openjdk/skara/forge/github/GitHubPullRequest.java line 263:
> 
>> 261:     }
>> 262: 
>> 263:     public List<ReviewComment> reviewComments(boolean includeLocationData) {
> 
> Can we make this method private?

Yes, we should.

-------------

PR Review Comment: https://git.openjdk.org/skara/pull/1593#discussion_r1431403083


More information about the skara-dev mailing list