Discovered while adding the support for the Check Suites API, our current logic makes a lot of unnecessary calls to the Organization.has_in_members() API to assess whether a comment has been made by a member of the organization.
This PR improves the implementation by caching the list of members when initializing the GitHub repository and reusing this list when detecting PRs. This should have no impact on the output and is mostly a performance improvement.
The easiest way to test is probably to run scc merge --info master -vv against an organizational repository with open PRs including comments:
without this PR, the command output should inlude multiple GET calls to the /orgs/<ORG>/members/<USER> endpoint per PR
with this PR, these should be replaced by a single top-level GET call to /orgs/<ORG_ID>/members and the output of the candidate detection should be identical
Discovered while adding the support for the Check Suites API, our current logic makes a lot of unnecessary calls to the
Organization.has_in_members()
API to assess whether a comment has been made by a member of the organization.This PR improves the implementation by caching the list of members when initializing the GitHub repository and reusing this list when detecting PRs. This should have no impact on the output and is mostly a performance improvement.
The easiest way to test is probably to run
scc merge --info master -vv
against an organizational repository with open PRs including comments:/orgs/<ORG>/members/<USER>
endpoint per PR/orgs/<ORG_ID>/members
and the output of the candidate detection should be identical