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

Empty backport causes endless retries of command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.0
    • None
    • bots
    • None

      If a user tries to /backport a commit that results in an empty change, the BackportCommand fails to realize this and just errors out. It will then endlessly retry the command. After a while, the failure mode will change as the repo in the scratch area already contains a branch with the backportBranchName, so the error message will be about the branch already existing.

      The BackportCommand needs to detect an empty change and report it to the user.

      This happened with this commit:
      https://github.com/openjdk/jdk11u-dev/commit/bf3438c5dc993b96d089cabb5318bfc64a6904a3

      This is the stacktrace from the first failure:

      java.io.UncheckedIOException: java.io.IOException: Unexpected exit code
      'git commit --message=Backport bf3438c5dc993b96d089cabb5318bfc64a6904a3' exited with status: 1
      [stdout]
      > On branch gnu-andrew-backport-bf3438c5
      > nothing to commit, working tree clean
      [stderr]
      at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.BackportCommand.handle(BackportCommand.java:237)
      at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.CommitCommandWorkItem.processCommand(CommitCommandWorkItem.java:133)
      at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.CommitCommandWorkItem.run(CommitCommandWorkItem.java:173)
      at org.openjdk.skara.bot/org.openjdk.skara.bot.BotRunner$RunnableWorkItem.runMeasured(BotRunner.java:190)
      at org.openjdk.skara.bot/org.openjdk.skara.bot.BotRunner$RunnableWorkItem.run(BotRunner.java:146)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.io.IOException: Unexpected exit code
      'git commit --message=Backport bf3438c5dc993b96d089cabb5318bfc64a6904a3' exited with status: 1
      [stdout]
      > On branch gnu-andrew-backport-bf3438c5
      > nothing to commit, working tree clean
      [stderr]
      at org.openjdk.skara.vcs/org.openjdk.skara.vcs.git.GitRepository.await(GitRepository.java:116)
      at org.openjdk.skara.vcs/org.openjdk.skara.vcs.git.GitRepository.commit(GitRepository.java:792)
      at org.openjdk.skara.vcs/org.openjdk.skara.vcs.git.GitRepository.commit(GitRepository.java:756)
      at org.openjdk.skara.vcs/org.openjdk.skara.vcs.git.GitRepository.commit(GitRepository.java:751)
      at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.BackportCommand.handle(BackportCommand.java:161)
      ... 10 more

            erikj Erik Joelsson
            erikj Erik Joelsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: