RFR: 2480: Add new PR command /ping

Erik Joelsson erikj at openjdk.org
Wed Apr 30 22:11:43 UTC 2025


On Wed, 30 Apr 2025 21:31:18 GMT, Zhao Song <zsong at openjdk.org> wrote:

> This PR is trying to add a new pull request command "ping".
> 
> The reported wants to have a pull request command that can refresh the timeouts of the pr so that the pr wouldn't be closed by pullRequestPrunerBot.
>  
> The reported proposed to name the command "keep-alive" with alias "/ping", however, we store command names in an Enum class, so "keep-alive" is invalid. I think we just use "ping" as the command name.
> 
> Besides, I would like to let the command trigger a force update of the pr. Currently, there are some cases that skara bot won't re-evaluate the pr automatically and users need to do something to poke it(like editing the pr title), so I think it's better to have a pull request command to trigger the update.

I'm not sure about the name. Perhaps "touch" would be a better analogy?

bots/pr/src/main/java/org/openjdk/skara/bots/pr/PingCommand.java line 41:

> 39:     @Override
> 40:     public String description() {
> 41:         return "Reset the timeouts for this pull request and re-evaluate the pull request.";

Suggestion:

        return "Re-evaluates the pull request and resets the inactivity timeout.";

bots/pr/src/main/java/org/openjdk/skara/bots/pr/PingCommand.java line 57:

> 55:     public void handle(PullRequestBot bot, PullRequest pr, CensusInstance censusInstance, ScratchArea scratchArea, CommandInvocation command, List<Comment> allComments, PrintWriter reply) {
> 56:         if (!pr.author().equals(command.user()) && !censusInstance.isReviewer(command.user())) {
> 57:             reply.println("Only the author of the pull request or [Reviewers](https://openjdk.org/bylaws#reviewer) are allowed to change the number of required reviewers.");

Copy-paste error?

I think we can allow any census member to use this command.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/PingCommand.java line 65:

> 63:         }
> 64: 
> 65:         reply.println("The timeouts for this pull request has been reset and this pull request will be re-evaluated soon." + PING_COMMAND_RESPONSE_MARKER);

Suggestion:

        reply.println("The pull request is being re-evaluated and the inactivity timeout has been reset." + PING_COMMAND_RESPONSE_MARKER);

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

PR Review: https://git.openjdk.org/skara/pull/1716#pullrequestreview-2808634969
PR Review Comment: https://git.openjdk.org/skara/pull/1716#discussion_r2069544460
PR Review Comment: https://git.openjdk.org/skara/pull/1716#discussion_r2069545084
PR Review Comment: https://git.openjdk.org/skara/pull/1716#discussion_r2069546448


More information about the skara-dev mailing list