RFR: 1963: Reduce the frequency of fetching the same issue from IssueProject in CheckRun

Zhao Song zsong at openjdk.org
Mon Jun 26 23:28:09 UTC 2023

On Mon, 26 Jun 2023 16:13:57 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> This patch adds a cache for `IssueTrackerIssue` in `CheckWorkItem`. This will ensure that we only ever fetch issues from the issue project once in each work item. I'm also inlining the rather common `IssueProject` null check wherever possible.
> Note that this patch is built on top of #1535 so will go in after that one.
> Doing this also fixes a flaw with the current metadata hash logic. At the end of a check run, the metadata hash is updated. The current implementation fetches all issues again at that point, which means that we may store an updated version of an issue, that hasn't been part of the check run, in the hash. With this change, we are guaranteed to store the same issue state as was used in the check run.

Looks good

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckWorkItem.java line 35:

> 33: import org.openjdk.skara.issuetracker.Issue;
> 34: import org.openjdk.skara.issuetracker.IssueTrackerIssue;
> 35: import org.openjdk.skara.json.JSONValue;

`import org.openjdk.skara.issuetracker.Issue;` and `import org.openjdk.skara.json.JSONValue;` can be removed


Marked as reviewed by zsong (Reviewer).

PR Review: https://git.openjdk.org/skara/pull/1536#pullrequestreview-1499697268
PR Review Comment: https://git.openjdk.org/skara/pull/1536#discussion_r1242919418

More information about the skara-dev mailing list