Uploaded image for project: 'Skara'
  1. Skara
  2. SKARA-1797

Add support for /backport pull request command

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.0
    • None
    • bots
    • None

      Skara already has support for the /backport commit command, see https://github.com/openjdk/skara/blob/master/bots/pr/src/main/java/org/openjdk/skara/bots/pr/BackportCommand.java for details. I'm proposing that we also make BackportCommand work on pull requests. This would be done by adding

         @Override
         boolean allowedInPullRequest() {
              return true;
         }

         @Override
         boolean allowedInBody() {
              return true;
         }

      to BackportCommand.java and then adding the implementation to the method

          @Override
          public void handle(PullRequestBot bot, PullRequest pr, CensusInstance censusInstance, Path scratchPath,
                      CommandInvocation command, List<Comment> allComments, PrintWriter reply) {
          }

      The workflow and logic I imagine is that a user issues for example "/backport jdk20" in a pull request comment (or in the pull request body). The bots will then reply that they will attempt to backport the pull request to the openjdk/jdk20 repository once the pull request has been integrated.

      Once the bots have integrated the pull request then they will notice that the pull request does contain a "/backport jdk20" and then proceed with essentially the same logic as in the code for the "/backport" commit command.

      There probably needs to be a special form om the command - "/backport none" or "/backport disable" if a user no longer wants a pull request to be backport (i.e. they made a mistake when typing e.g. "/backport jdk20").

      It would probably also be nice to add a label to the pull request of the form "backport=jdk20". This label could also be the thing the bots look for after integrating to determine whether the commit resulting from the pull request should be backported.

      Finally it would be nice to update the pull request body to clearly state the repository that the resulting commit will be backported to.

            zsong Zhao Song
            ehelin Erik Helin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: