RFR: 2122: Minor bot optimizations for GitHub API

Erik Joelsson erikj at openjdk.org
Fri Dec 15 22:13:45 UTC 2023


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.

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

Commit messages:
 - Increase per_page to max 100 for pr lists
 - reviewComments optimization

Changes: https://git.openjdk.org/skara/pull/1593/files
 Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1593&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-2122
  Stats: 65 lines in 3 files changed: 22 ins; 1 del; 42 mod
  Patch: https://git.openjdk.org/skara/pull/1593.diff
  Fetch: git fetch https://git.openjdk.org/skara.git pull/1593/head:pull/1593

PR: https://git.openjdk.org/skara/pull/1593


More information about the skara-dev mailing list