[JIRA] (JENKINS-37171) mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin

2016-10-14 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick commented on  JENKINS-37171  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin   
 

  
 
 
 
 

 
 Yes and wiki.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-37171) mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin

2016-10-14 Thread nicolas33tho...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Nicolas Thomas commented on  JENKINS-37171  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin   
 

  
 
 
 
 

 
 Jesse Glick, when you talk about Declarative Pipeline, are you talking about what I found here: https://jenkins.io/blog/2016/09/19/blueocean-beta-declarative-pipeline-pipeline-editor/ ?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-37171) mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin

2016-10-14 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-37171  
 
 
  mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin   
 

  
 
 
 
 

 
Change By: 
 Jesse Glick  
 
 
Labels: 
 mailer  pipeline  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-37171) mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin

2016-10-14 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick assigned an issue to Unassigned  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Currently catchError sets no result when the block succeeds. Probably it could set it to STABLE if not already set. CoreStepTest.mailer tests some related scenarios but I guess not this one. Anyway you should probably be using Declarative Pipeline, which handles this sort of thing without custom scripting.  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-37171  
 
 
  mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin   
 

  
 
 
 
 

 
Change By: 
 Jesse Glick  
 
 
Component/s: 
 workflow-basic-steps-plugin  
 
 
Component/s: 
 mailer-plugin  
 
 
Component/s: 
 pipeline  
 
 
Priority: 
 Major Minor  
 
 
Assignee: 
 Jesse Glick  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 

[JIRA] (JENKINS-37171) mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin

2016-10-13 Thread nicolas33tho...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Nicolas Thomas commented on  JENKINS-37171  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin   
 

  
 
 
 
 

 
 I had the same issue. I found some topics on google that explained tha this is because the currentBuild.result is not yet set and null. Your Failure works because you set it yourself. In my side, my workaround is to wrap the whole pipeline in a try / catch / finally. If the pipeline fall in the catch, that means that an exception is thrown so i mark the build as failed. In the finally, if currentBuil.result is null, I assume that it should be SUCCESS, so I set it myself. Then, again in the finally block, I call the Mailer step. It works for both, failures an back to stable notifications. It us a workaround. I'm not a big fan of bypassing the pipeline final result management. I don't know if something can be done to not have to do it.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-37171) mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin

2016-08-04 Thread pietrek.tom...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Tomasz Pietrek created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-37171  
 
 
  mailer doesn't send "back to normal" mail if used in pipelne (worflow) plugin   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Jesse Glick  
 
 
Components: 
 mailer-plugin, workflow-plugin  
 
 
Created: 
 2016/Aug/04 8:04 AM  
 
 
Environment: 
 Jenkins 2.14 running in docker container  Mailer plugin 1.17  Pipeline: API 2.1  
 
 
Labels: 
 workflow pipeline mailer  
 
 
Priority: 
  Major  
 
 
Reporter: 
 Tomasz Pietrek  
 

  
 
 
 
 

 
 Mailer doesn't send "back to normal" email, when pipeline gets green after failed build. The "failed build" email is send properly. The issue occurs only if plugin is used inside pipeline script. Example to reproduce: 

 

node {
catchError {
  stage "random fail"
  Random random = new Random();
  int randomNumber = random.nextInt(10 - 1) + 1;
  echo "${randomNumber}"
  if (randomNumber > 5) {
echo "in loop"
currentBuild.result = 'FAILURE'
error "failed"
  }
}
echo "after finally"
step([$class: 'Mailer', recipients: 'tomasz.piet...@sap.com'])
}
 

 The same issue occurs if code is wrapped with try, catch, finally instead of catchError