ome / scc

OME tools for managing the Git(Hub) workflow
https://pypi.org/project/scc/
GNU General Public License v2.0
0 stars 15 forks source link

Reduce number of organization API calls #265

Closed sbesson closed 3 years ago

sbesson commented 3 years ago

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:

joshmoore commented 3 years ago

Good catch :+1:

sbesson commented 3 years ago

Proposing to get a quick patch release out with this fix included if no objection @joshmoore