RFR: 1070: An invalid /backport command target causes bot to fail endlessly

Kevin Rushforth kcr at openjdk.java.net
Fri Jun 4 22:58:07 UTC 2021

On Fri, 4 Jun 2021 22:21:31 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> If a user issues a /backport command on a commit on a repository that exists, but for which we haven't properly configured backports to work (they need a fork defined where the PR can be created from), we currently end up with endless failures. This patch adds handling of the situation by printing a helpful message for the user, which also includes a list of all valid repositories.

Looks good. I made a suggestion (for a follow-up).

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

> 111:                 reply.print("@" + username + " [" + repoName + "](" + targetRepo.webUrl() + ") is not a valid target for backports. ");
> 112:                 reply.print("List of valid repositories: ");
> 113:                 reply.println(String.join(", ", bot.forkRepoNames()));

Should this be further filtered to only list repos that have the same "base" (share some commits) as the source repo? For example, if we some day configure one of the `jfx` or `jmc` update release repos to allow backport APIs, you wouldn't want to target it from a commit in the `jdk` repo, so listing those repos could be confusing. This could be done as a follow-up, since it is only a hypothetical problem for now.


Marked as reviewed by kcr (Reviewer).

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

More information about the skara-dev mailing list