jenkinsci / slack-plugin

A Jenkins plugin for posting notifications to a Slack channel
https://plugins.jenkins.io/slack/
MIT License
669 stars 413 forks source link

Slack notification is broken with latest plugin #447

Closed matejsp closed 5 years ago

matejsp commented 5 years ago

When having setup global slack notifier it crashes: RunListener failed java.lang.NoSuchMethodError: jenkins.plugins.slack.SlackNotifier$DescriptorImpl.getBotUser()Z at org.jenkinsci.plugins.globalslack.GlobalSlackNotifier.publish(GlobalSlackNotifier.java:66) at org.jenkinsci.plugins.globalslack.GlobalSlackNotifier.onCompleted(GlobalSlackNotifier.java:32) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:586) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$900(WorkflowRun.java:133) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:998) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1440) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:417) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

matejsp commented 5 years ago

The crash is originating in another plugin that accesses public API of this plugin. And this plugin just broke backwards compatibility :(. It would be better to mark the method with @Deprecated and after a major version bump remove it.

https://github.com/jenkinsci/global-slack-notifier-plugin/blob/master/src/main/java/org/jenkinsci/plugins/globalslack/GlobalSlackNotifier.java

matejsp commented 5 years ago

This specific error is fixed, but new incompatibility introduced in 2.10 is now reported in https://github.com/jenkinsci/slack-plugin/issues/450