Description
If an author without integration permission issues '/integrate auto' and a committer then issues '/sponsor' before after the PR is marked with label 'auto', but before the bot has added the automatic '/integrate' and posted the 'ready for sponsor message', then the SponsorCommand will get stuck in a failure loop like this:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.orElseThrow(Optional.java:377)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.SponsorCommand.handle(SponsorCommand.java:62)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.CommandHandler.handle(CommandHandler.java:42)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.PullRequestCommandWorkItem.processCommand(PullRequestCommandWorkItem.java:144)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.PullRequestCommandWorkItem.prRun(PullRequestCommandWorkItem.java:193)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.PullRequestWorkItem.run(PullRequestWorkItem.java:66)
at org.openjdk.skara.bot/org.openjdk.skara.bot.BotRunner$RunnableWorkItem.runMeasured(BotRunner.java:236)
at org.openjdk.skara.bot/org.openjdk.skara.bot.BotRunner$RunnableWorkItem.run(BotRunner.java:186)
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)
Together withSKARA-1534, this is also causing the bot to repost '/integrate' over and over again.
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.orElseThrow(Optional.java:377)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.SponsorCommand.handle(SponsorCommand.java:62)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.CommandHandler.handle(CommandHandler.java:42)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.PullRequestCommandWorkItem.processCommand(PullRequestCommandWorkItem.java:144)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.PullRequestCommandWorkItem.prRun(PullRequestCommandWorkItem.java:193)
at org.openjdk.skara.bots.pr/org.openjdk.skara.bots.pr.PullRequestWorkItem.run(PullRequestWorkItem.java:66)
at org.openjdk.skara.bot/org.openjdk.skara.bot.BotRunner$RunnableWorkItem.runMeasured(BotRunner.java:236)
at org.openjdk.skara.bot/org.openjdk.skara.bot.BotRunner$RunnableWorkItem.run(BotRunner.java:186)
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)
Together with