janinko/ghprb — pull request #108 by alex-bezrodniy (2013-12-24 15:19:49+00:00)
Title: Ghprb - issue 92

We had a great number of requests to API that we don't really need.

API usage calculations (for general case when we have no new PR, but have a lot of active ones):

For more that 20 open PR for the same API key can exceed API limit.

Problems:
1. We invoke "Obtain author" and «checkMergeable» for all pull requests, not only for new\modified. But really we need authorEmail and information whether the brunch is mergeable only if brunch must be re-builded.

So, I moved this logic to the build method and added corresponding conditions.

2. “Check mergeable” made 3 calls to Github API (Checked locally), but really we need only one here.
In part it’s a problem of GitHub Java API library, that populate values even if they are already specified.
It was fixed by introducing local variable and moving api polling inside the loop.