RFR: Cache labels in GitHubPullRequest

Robin Westberg rwestberg at openjdk.java.net
Thu Dec 5 09:35:39 UTC 2019


On Thu, 5 Dec 2019 09:21:02 GMT, Erik Helin <ehelin at openjdk.org> wrote:

> Hi all,
> 
> please review this pull request that introduces a simple label cache for `GitHubPullRequest`. Since a `GitHubPullRequest` instance can't be accessed by multiple threads it is safe to use a very simple cache mechanism. The only calls that can mutate labels on a PR are `addLabel` and `removeLabel`. A user on GitHub could of course add a label, but we make no guarantees that a `GitHubPullRequest` instance reflects what happens on GitHub, code wanting to ensure they have the latest state must create a new `GitHubPullRequest` instance.
> 
> Thanks,
> Erik

Looks good! I think it would be reasonable to do similar caching for other PR properties such as comments, but that can be done at some other time.

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

Marked as reviewed by rwestberg (Reviewer).

PR: https://git.openjdk.java.net/skara/pull/294


More information about the skara-dev mailing list