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

unclear usage of input step in declarative pipeline

    Details

    • Similar Issues:

      Description

      How is the input step intended to be used in a declarative pipeline using a separate block (JENKINS-48379)? There are several issues with this.

      • The result of the input can only be used in the current stage. Thus, it is not possible to skip multiple stages or use the input value in multiple stages.
      • input and when cannot be combined in all cases. Currently, the result of input can be used in when to skip the stage (cool!). However, if the stage is skipped because of some other criteria, the input is still requested.
      • input cannot be used inside the stage steps as a workaround because the agent would be blocked and it cannot be separated to two steps (approval without agent, handling with agent) because the input result is stage-local.

      If I missed something and the issues can be solved, it would be nice to know and the documentation should be more clear about this. Currently, it seems impossible to create a declarative pipeline with a manual approval step before a deployment when the process also depends on other criteria (e.g. the branch in a multibranch pipeline).

        Attachments

          Issue Links

            Activity

            Hide
            fitzplb Liam Fitzpatrick added a comment -

            I have a similar issue to Fernando Nasser. I have 2 parallel stages, one for dev and one for prod and a when condition determines which stage to run based on the environment. I want to prompt for input in the prod stage only but as the input happens before the when I get prompted for input in regardless of the environment, 

            Show
            fitzplb Liam Fitzpatrick added a comment - I have a similar issue to Fernando Nasser . I have 2 parallel stages, one for dev and one for prod and a when condition determines which stage to run based on the environment. I want to prompt for input in the prod stage only but as the input happens before the when I get prompted for input in regardless of the environment, 
            Hide
            fnasser Fernando Nasser added a comment -

            Perhaps add a 'when' configuration option to the 'input' directive?

            This way we could skip the input for certain cases (like for Liam's prod stage) or even have a different input for each case by playing with the right 'when' conditions.

            Show
            fnasser Fernando Nasser added a comment - Perhaps add a 'when' configuration option to the 'input' directive? This way we could skip the input for certain cases (like for Liam's prod stage) or even have a different input for each case by playing with the right 'when' conditions.
            Hide
            abayer Andrew Bayer added a comment -

            We're adding the ability to have when be evaluated before input runs over at JENKINS-50880.

            Show
            abayer Andrew Bayer added a comment - We're adding the ability to have when be evaluated before input runs over at JENKINS-50880 .
            Hide
            fnasser Fernando Nasser added a comment -

            OK, just for the sake of people who look at this JIRA.

             

            How do we get  when first, input after ?

             

            How do we get  input first, when after ?

             

             

            Show
            fnasser Fernando Nasser added a comment - OK, just for the sake of people who look at this JIRA.   How do we get  when first, input after ?   How do we get  input first, when after ?    
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                aklemp Andreas Klemp
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: