RFR: 1925: When archiving a comment, mlbridgeBot would strip everything after the first command

Erik Joelsson erikj at openjdk.org
Fri Jun 2 15:08:21 UTC 2023

On Thu, 1 Jun 2023 22:24:34 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> A user reported that there is no email generated for this comment. 
>> https://github.com/openjdk/jdk/pull/14114#issuecomment-1562126987 
>> It is caused by the initial `/csr needed` command. The root cause is that in `ArchiveWorkItem#ignoreComment`, any command would be treated as a multiline command. 
>> The logic about filtering out commands from a comment differs between `ArchiveWorkItem#ignoreComment` and `CommandExtractor#extractCommands`.
>> In this patch, I make the logic consistent in this two methods.
>> 1. Any line starts with '/' followed by lowercase characters will be recognized as a command line. The command line will be stripped. 
>> 2. Check whether this command is a multiline command. If so, the following lines will be considered as arguments of the command and the argument lines will be stripped until the bot found another command line.
> bots/mlbridge/src/main/java/org/openjdk/skara/bots/mlbridge/ArchiveWorkItem.java line 143:
>> 141:     }
>> 142: 
>> 143:     private boolean ignoreComment(HostUser author, String body, ZonedDateTime createdTime, ZonedDateTime lastDraftTime, boolean isComment) {
> Introduced argument `isComment` to this method because I think in any case, no review should be ignored. But according to the previous logic, if a review whose body only contains command, the review would be ignored.

I'm not sure about this. We already send email when someone approves a PR. I don't think we need to send emails with an empty review.


PR Review Comment: https://git.openjdk.org/skara/pull/1524#discussion_r1214496136

More information about the skara-dev mailing list