RFR: 596: Allow short-hand syntax for /label command

Guoxiong Li gli at openjdk.java.net
Tue Dec 7 14:26:38 UTC 2021


On Tue, 7 Dec 2021 14:00:38 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Hi all,
>> 
>> This patch adds the short-hand syntax for `/label` command. The short-hand syntax makes the users easily add and remove the labels in one comment.
>> 
>> Some example:
>> 
>> Add a label: `/label +labelName`
>> Remove a label: `/label -labelName`
>> Mixed: `/label +labelName, -labelName2`
>> Mixed: `/label labelName, +labelName2, -labelName3`
>> 
>> 
>> And the test cases are added.
>> 
>> Thanks for taking the time to review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> bots/pr/src/main/java/org/openjdk/skara/bots/pr/LabelCommand.java line 123:
> 
>> 121: 
>> 122:     private void printInvalidLabels(List<String> invalidLabels, PullRequestBot bot, PrintWriter reply) {
>> 123:         reply.println(""); // Intentionally blank line.
> 
> Why a blank line? I can't see anything printed before this method is called.

The `@username` will be printed at first. If the invalid labels is more than 2. The output will be:


@username The label `labelName` is not a valid label.
The label `labelName` is not a valid label.


I would like to adjust it to :


@username
The label `labelName` is not a valid label.
The label `labelName` is not a valid label.

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

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


More information about the skara-dev mailing list