RFR: 2304: /backport jdk23 should provide a more helpful message

Erik Joelsson erikj at openjdk.org
Wed Jul 3 06:57:12 UTC 2024


On Tue, 2 Jul 2024 18:15:21 GMT, Zhao Song <zsong at openjdk.org> wrote:

> This patch is trying to improve the bot's replies of backport command.
> 
> 1. If the user issued `/backport jdkX`, the bot would check if there is a `jdkX` branch in current repo, if so, the bot would tell the user that to target a backport to `jdkX` branch in current repo, he should issue `/backport :jdkX`.
> 
> 2. When user specified branch name in the command but the branch doesn't exist, the bot will list 10 branch names in the target repo, the branch names are just sorted in reverse alphabetical order, so we can't guarantee they are the most relevant ones.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/BackportCommand.java line 205:

> 203:                 reply.println("There is a branch `" + repoName + "` in current repository `" + bot.repo().name() + "`.");
> 204:                 reply.println("To target a backport to this branch in current repository:");
> 205:                 reply.println("`/backport :" + repoName + "`");

Suggestion:

                reply.println("There is a branch `" + repoName + "` in the current repository `" + bot.repo().name() + "`.");
                reply.println("To target a backport to this branch in the current repository use:");
                reply.println("`/backport :" + repoName + "`");

bots/pr/src/main/java/org/openjdk/skara/bots/pr/BackportCommand.java line 208:

> 206:                 reply.println();
> 207:             }
> 208:             reply.println("The target repository `" + repoNameArg + "` is not a valid target for backports. ");

I think this line should be first in the message, then followed by the branch message if there is a branch match.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/BackportCommand.java line 225:

> 223:         if (targetBranchHash.isEmpty()) {
> 224:             reply.println("The target branch `" + targetBranchName + "` does not exist");
> 225:             reply.print("List of target branches: ");

Suggestion:

            reply.print("List of valid branches: ");

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

PR Review Comment: https://git.openjdk.org/skara/pull/1667#discussion_r1663609011
PR Review Comment: https://git.openjdk.org/skara/pull/1667#discussion_r1663607601
PR Review Comment: https://git.openjdk.org/skara/pull/1667#discussion_r1663614230


More information about the skara-dev mailing list