I have been wondering for ages why is there no `timeout` option in the `input` step? I am aware you can wrap your input in a `timeout() {}`, but that is just impossible when you are using the `input` as part of the stage like so:

       

      pipeline {
          agent any
          stages {
              stage('Example') {
                  input {
                      message "Should we continue?"
                      ok "Yes, we should."
                      submitter "alice,bob"
                      parameters {
                          string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
                      }
                  }
                  steps {
                      echo "Hello, ${PERSON}, nice to meet you."
                  }
              }
          }
      }

       

      (Taken from https://jenkins.io/blog/2018/04/09/whats-in-declarative/#input)

       

      The possible "workaround" to this would be to create an `input` step in a previous stage which is wrapped in a `timeout` step, but in our case this makes things even more complicated and hard to read. 

      Are there any plans to include an `timeout` parameter for the `input` step? Maybe something like this (or better?):

       

      input { 
        message "Should we continue?" 
        ok "Yes, we should." 
        submitter "alice,bob" 
        timeout: [time: 1234, unit: 'MINUTES']
        parameters { 
          string(
            name: 'PERSON', 
            defaultValue: 'Mr Jenkins', 
            description: 'Who should I say hello to?'
          ) 
        }
      }

       

       

          [JENKINS-56259] Allow input timeout parameter

          Steve Todorov created issue -
          Steve Todorov made changes -
          Link New: This issue blocks JENKINS-36235 [ JENKINS-36235 ]
          Jesse Glick made changes -
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: pipeline [ 21692 ]
          Component/s Original: pipeline-input-step-plugin [ 21708 ]

          Jesse Glick added a comment -

          Specific to Declarative Pipeline; adjusted component accordingly.

          Jesse Glick added a comment - Specific to Declarative Pipeline; adjusted component accordingly.

          Steve Todorov added a comment -

          jglick thanks for fixing that! Apologize for the wrong component

          Steve Todorov added a comment - jglick thanks for fixing that! Apologize for the wrong component

          carlspring added a comment -

          Hi jglick

           

          Is there any update on this?

           

          carlspring added a comment - Hi  jglick ,    Is there any update on this?  

          Mark Vinkx added a comment -

          You simply can wrap the input in a timeout 

                  stages {
                      stage('Deploy') {
                          steps {
                                      timeout(time: 5, unit: "MINUTES") {
                                          input message: 'Do you want to approve the deploy?', ok: 'Yes'
                                      }
                                      sh './flakey-deploy.sh'
                           }
                      }
                  }
          

          Mark Vinkx added a comment - You simply can wrap the input in a timeout  stages { stage( 'Deploy' ) { steps { timeout(time: 5, unit: "MINUTES" ) { input message: 'Do you want to approve the deploy?' , ok: 'Yes' } sh './flakey-deploy.sh' } } }

          Jesse Glick added a comment -

          markv this is about input as part of a stage rather than one of its steps, which has different behavior (if I understand correctly) with respect to when an executor is locked.

          Jesse Glick added a comment - markv this is about input as part of a stage rather than one of its steps , which has different behavior (if I understand correctly) with respect to when an executor is locked.

          Steve Todorov added a comment -

          markv Yes, you could wrap the input like that, but unfortunately this means that you will allocate an agent and have it do nothing for 5 minutes. Also the Blue Ocean UI would display this stage as "passed" (green) which will be (and is) confusing, because you never know if the stage has actually passed or it has been skipped/not approved - you will need to specifically go into the stage to check the steps, whereas if you have it as a stage input it would show in the UI as skipped. 

          jglick yes, you've understood me correctly

          Steve Todorov added a comment - markv Yes, you could wrap the input like that, but unfortunately this means that you will allocate an agent and have it do nothing for 5 minutes. Also the Blue Ocean UI would display this stage as "passed" (green) which will be (and is) confusing, because you never know if the stage has actually passed or it has been skipped/not approved - you will need to specifically go into the stage to check the steps, whereas if you have it as a stage input it would show in the UI as skipped.  jglick yes, you've understood me correctly

          Hi, has there been any other movement on this particular functionality?

          I've been looking into using pipeline as code to automate deployments and use the steps in stages approach to manage the different elements of the CI process. Having the ability to specify a timeout directly on the input option would be perfect as it appears the stage method does not accept timeout as a valid nested parameter.

          Jordan Cockles added a comment - Hi, has there been any other movement on this particular functionality? I've been looking into using pipeline as code to automate deployments and use the steps in stages approach to manage the different elements of the CI process. Having the ability to specify a timeout directly on the input option would be perfect as it appears the stage method does not accept timeout as a valid nested parameter.

            Unassigned Unassigned
            stodorov Steve Todorov
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: