RFR: 394: Merge bot conflict resolution interaction requires separate credentials
Robin Westberg
rwestberg at openjdk.java.net
Mon May 11 07:14:37 UTC 2020
On Fri, 8 May 2020 15:51:57 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Hi all,
>>
>> Please review this change that allows the pull request bot to recognize specially formatted command comments made by
>> "itself" (most likely another bot using the same credentials).
>> Best regards,
>> Robin
>
> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CommandWorkItem.java line 42:
>
>> 41: private final Pattern commandReplyPattern = Pattern.compile("<!-- Jmerge command reply message
>> \\((\\S+)\\) -->"); 42: private final String selfCommandMarker = "<!-- Valid self-command -->";
>> 43:
>
> FWIW, these fields could also be made `static` as well.
Makes sense, will fix.
> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CommandWorkItem.java line 91:
>
>> 90: .map(comment -> new AbstractMap.SimpleEntry<>(comment,
>> commandPattern.matcher(comment.body()))) 91: .filter(entry ->
>> !entry.getKey().author().equals(self) || entry.getKey().body().endsWith(selfCommandMarker)) 92:
>> .filter(entry -> entry.getValue().find())
>
> Could you move this above the `.map(...)` call, so that you can replace `entry.getKey()` with `comment`? (just like
> before)
Ah, good catch, at first I intended to match the override marker with the regular expression, but it didn't end up that
way, so can revert this.
-------------
PR: https://git.openjdk.java.net/skara/pull/618
More information about the skara-dev
mailing list