[JIRA] (JENKINS-58322) IgnoreError step

15 views
Skip to first unread message

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 9:46:03 AM7/3/19
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo created an issue
 
Jenkins / New Feature JENKINS-58322
IgnoreError step
Issue Type: New Feature New Feature
Assignee: Ivan Fernandez Calvo
Components: workflow-basic-steps-plugin
Created: 2019-07-03 13:45
Priority: Minor Minor
Reporter: Ivan Fernandez Calvo

On the issue https://issues.jenkins-ci.org/browse/JENKINS-45579 Devin Nusbaum has added a couple of really nice steps WarnErrorStep and CatchErrorStep, this improvement is a continuation of his work (mostly copy) to add another user case, when you need to ignore the failure of a stage but you want to mar the build as successful and it is not possible to use CatchErrorStep or you want to simplify your stage code, something like the following stage that it is waiting for an input on declarative where you can not use CatchErrorStep for the input, ignoreErrors option would mark the build as SUCCESS and the stage as UNSTABLE.

stage('Release Candidate') {
  agent any
  options {
    ignoreErrors('Release Candidate was not uploaded')
  }
  input {
    message 'Should we upload the Release Candidate version?'
    ok 'Yes, we should.'
  }
  when {
    beforeAgent true
    beforeInput true
    anyOf {
      tag "rc-\\d+\\.\\d+\\.\\d+*"
    }
  }
  steps {
    echo "My Release Candidate process"
  }
}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 9:54:03 AM7/3/19
to jenkinsc...@googlegroups.com

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 9:54:03 AM7/3/19
to jenkinsc...@googlegroups.com
Status: Open In Progress

dnusbaum@cloudbees.com (JIRA)

unread,
Jul 3, 2019, 9:56:02 AM7/3/19
to jenkinsc...@googlegroups.com
Devin Nusbaum commented on New Feature JENKINS-58322
 
Re: IgnoreError step

Ivan Fernandez Calvo Thanks for the RFE. I'm not quite sure what ignoreErrors is doing in your example, it looks like a block scope step because it is in options, but by your description it sounds like a basic step like unstable?

If I understand correctly, maybe better to just add option to the unstable step, so it could be used like this:

unstable(message: "Release candidate was not uploaded", setBuildResult: false)

If you mean for ignoreErrors to act like catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE'), I think you could just put that in options today, like this (untested):

options {
  catchError(message: 'Release Candidate was not uploaded', buildResult: 'SUCCESS', stageResult: 'UNSTABLE')
}

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 1:15:03 PM7/3/19
to jenkinsc...@googlegroups.com
Status: In Review Closed
Resolution: Won't Do

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 1:15:03 PM7/3/19
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo commented on New Feature JENKINS-58322
 
Re: IgnoreError step

you are right, this thing does not make sense, it is the same

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 1:19:02 PM7/3/19
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo edited a comment on New Feature JENKINS-58322
 
Re: IgnoreError step
you are right, this thing does not make sense, it is the same . I did not see it because *catchError* is not available to select in the *Declarative Directive Generator*, you only can select *wramError*

kuisathaverat@gmail.com (JIRA)

unread,
Jul 3, 2019, 3:04:02 PM7/3/19
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo commented on New Feature JENKINS-58322
 
Re: IgnoreError step

Devin Nusbaum for the declarative input step seems there is not a good solution to catch the ABORT and transform it in another thing, I'll continue playing with it to find a solution.

Reply all
Reply to author
Forward
0 new messages