Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56941

Declarative + Blue Ocean - Issue when conditional block having input steps inside parallel blocks return false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • 2.164.1-cb-1

      Multiple Inputs do not work inside parallel inside Blue Ocean inside declarative when using when condition returning false for one stage

      What is the incorrect behaviour?

      The issue is that inside Blue Ocean, when this is the case, there are no prompts for input steps presented to the user.

      Also, the console output in Blue Ocean shows the input step, but you are unable to select anything.

      This does not happen when exiting Blue Ocean.

      What is the expected behaviour?

      Expect to be prompted for input steps in Blue Ocean UI.

      Step by step to reproduce

      The below demonstrates a scenario where 2 input steps are defined inside a parallel block. In this case the when block will return true for one stage and false for the other.

      pipeline {
        agent any
        environment {
          CI = 'true'
        }
        stages {
          stage('Release') {
            parallel { // change parallel -> stages
              stage('DEV') {
                when {
                  beforeAgent true
                  beforeInput true
                  expression {return false;}
                }
                input {
                  message 'Approved for DEV release?'
                  ok 'Deploy'
                }
                steps {
                  echo 'releasing'
                }
              }
              stage('UAT') {
                when {
                  beforeAgent true
                  beforeInput true
                  expression {return true;}
                }
                input {
                  message 'Approved for UAT release?'
                  ok 'Deploy'
                }
                steps {
                  echo 'releasing'
                } 
              }
            }
          }
        }
      }
      

      Workaround

      Removing parallel fixes it.

      Also, if you change

       parallel { // change parallel -> stages
      

      then it works. So, it works sequentially.

            Unassigned Unassigned
            owood Owen Wood
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: