RFR: 2061: Checking for .jcheck/conf fails when pr/X branches are removed
Erik Joelsson
erikj at openjdk.org
Thu Oct 12 15:01:18 UTC 2023
On Thu, 12 Oct 2023 14:16:22 GMT, Zhao Song <zsong at openjdk.org> wrote:
> As Erik described in the issue, "The targetRefPRMap introduced in [SKARA-1937](https://bugs.openjdk.org/browse/SKARA-1937) isn't working well with the dependent PR feature. When a pr/X branch is removed, the map may still contains that branch which will cause getPeriodicItems to fail with exception when trying to get .jcheck/conf from the non existing branch.".
>
> To solve this issue, I think that every pr would only have one targetRef, so before the bot is trying to create an entry for the pr, the bot should delete any existing entry associated with that pr.
>
> Since the operations are all about HashMap, I believe they wouldn't significantly impact the bot's performance.
bots/pr/src/main/java/org/openjdk/skara/bots/pr/PullRequestBot.java line 185:
> 183: var prId = pr.id();
> 184: if (pr.isOpen()) {
> 185: targetRefPRMap.keySet().forEach(key -> targetRefPRMap.get(key).remove(prId));
I think this could be simplified by just iterating over `targetRefPRMap.values()`.
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1568#discussion_r1356953766
More information about the skara-dev
mailing list