Improvements for 'when' section

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      It would be nice to improve when section in stage pipeline when user input and timeout.

      Currently we have to write code like this:

      when {
        boolean publish
        try {
          timeout(time: 1, unit: 'MINUTES') {
            input 'Deploy pages?'
            publish = true
          }
        } catch (final ignore) {
          publish = false
        }
      publish
      }
      

      Which is:

      • very long
      • bad practise (catch and ignore)
      • unclear

      My proposition is to make additional clause, which could look like this:

      when {
        input message: 'Deploy pages?', time: 1, unit: 'MINUTES', failWhenTimeout: false
      }
      

      Default parameters could be:

      • message: Proceed or Abort?
      • time: 5
      • unit: MINUTES
      • failWhenTimeout: false

            Assignee:
            Andrew Bayer
            Reporter:
            Piotr Joński
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: