Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Fix recovery notification - Closes #944 #950

Merged
merged 2 commits into from
Nov 6, 2017

Conversation

fchavant
Copy link
Contributor

@fchavant fchavant commented Nov 3, 2017

It appears currentBuild.result can be null if the build is passing.
Ref. https://jenkins.io/doc/book/pipeline/jenkinsfile/#deploy

What was the problem?

It appears currentBuild.result can be null for a successful build.

How did I fix it?

Changed the success condition to check not only for "SUCCESS" but also for null.

How to test it?

  • make the build fail (e.g. by using Jenkins' replay feature executing sh 'false')
    • a failure notification should be sent to Slack
  • build again normally
    • this time the build should not fail
    • a recovery notification should be sent to Slack

Review checklist

It appears currentBuild.result can be null if the build is passing.
Ref. https://jenkins.io/doc/book/pipeline/jenkinsfile/#deploy
@fchavant fchavant self-assigned this Nov 3, 2017
@fchavant fchavant requested a review from slaweet November 3, 2017 11:44
Copy link
Contributor

@slaweet slaweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works :-) Thank you @fchavant

@fchavant fchavant merged commit e4c9b86 into 1.3.0 Nov 6, 2017
@fchavant fchavant deleted the 944-fix-recovery-notification branch November 6, 2017 08:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants