-
Improvement
-
Resolution: Not A Defect
-
Major
-
None
-
- Jenkins 2.95
- Email Extension Plugin 2.61
@Override public boolean isApplicable(Class<? extends Job> jobType) { return !jobType.getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob"); }
I wonder what is the problem with supporting `WorkflowJob` here? I believe, it is the job class used in both scripted and declarative pipelines. Pipeline script
node {
emailext recipientProviders: [[$class: 'ListRecipientProvider']]
}
gives me the following error:
java.lang.IllegalArgumentException: The following recipient providers do not support org.jenkinsci.plugins.workflow.job.WorkflowJob hudson.plugins.emailext.plugins.recipients.ListRecipientProvider at hudson.plugins.emailext.plugins.RecipientProvider.checkAllSupport(RecipientProvider.java:57) at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:186) at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:163) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:273) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) 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)
I am trying to make email-ext in my scripted pipeline job send email notifications to the globally configured recipients list—the same that is used in the following freestyle job:
[JENKINS-55335] Support scripted and declarative pipelines in `ListRecipientProvider`
Environment |
New:
- Jenkins 2.95 - Email Extension Plugin 2.61 |
Summary | Original: Support scripted pipelines in `ListRecipientProvider` | New: Support scripted and declarative pipelines in `ListRecipientProvider` |
Description |
Original:
[https://github.com/jenkinsci/email-ext-plugin/blob/ac54d2684668d12eae40189a55a30e677a813b03/src/main/java/hudson/plugins/emailext/plugins/recipients/ListRecipientProvider.java#L60] {code:java} @Override public boolean isApplicable(Class<? extends Job> jobType) { return !jobType.getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob"); } {code} I wonder what is the problem with supporting `WorkflowJob` here? I believe, it is the job class used in scripted pipelines. Pipeline script {code:java} node { emailext recipientProviders: [[$class: 'ListRecipientProvider']] } {code} gives me the following error: {code:java} java.lang.IllegalArgumentException: The following recipient providers do not support org.jenkinsci.plugins.workflow.job.WorkflowJob hudson.plugins.emailext.plugins.recipients.ListRecipientProvider at hudson.plugins.emailext.plugins.RecipientProvider.checkAllSupport(RecipientProvider.java:57) at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:186) at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:163) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:273) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) 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) {code} I am trying to make email-ext in my scripted pipeline job send email notifications to the globally configured recipients list—the same that is used in the following freestyle job: !freestyle job configuration.png|thumbnail! |
New:
[https://github.com/jenkinsci/email-ext-plugin/blob/ac54d2684668d12eae40189a55a30e677a813b03/src/main/java/hudson/plugins/emailext/plugins/recipients/ListRecipientProvider.java#L60] {code:java} @Override public boolean isApplicable(Class<? extends Job> jobType) { return !jobType.getName().equals("org.jenkinsci.plugins.workflow.job.WorkflowJob"); } {code} I wonder what is the problem with supporting `WorkflowJob` here? I believe, it is the job class used in both scripted and declarative pipelines. Pipeline script {code:java} node { emailext recipientProviders: [[$class: 'ListRecipientProvider']] } {code} gives me the following error: {code:java} java.lang.IllegalArgumentException: The following recipient providers do not support org.jenkinsci.plugins.workflow.job.WorkflowJob hudson.plugins.emailext.plugins.recipients.ListRecipientProvider at hudson.plugins.emailext.plugins.RecipientProvider.checkAllSupport(RecipientProvider.java:57) at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:186) at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:163) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:273) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) 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) {code} I am trying to make email-ext in my scripted pipeline job send email notifications to the globally configured recipients list—the same that is used in the following freestyle job: !freestyle job configuration.png|thumbnail! |
Assignee | Original: David van Laatum [ davidvanlaatum ] | New: Alex Earl [ slide_o_mix ] |
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |