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

User can run parametrised pipeline

    XMLWordPrintable

    Details

    • Epic Link:
    • Sprint:
      tethys
    • Similar Issues:

      Description

      Parametrised pipelines are to be supported in blue ocean.
      This means when a user presses run (either on a branch, dashboard favourite, or non multibranch button) it will need to immediately pop up asking for input. The run will not commence until input is captured. If user cancels it, no run starts.

      There is a linked design ticket for how this looks (and api)

      In scope:

      • Form to dynamically render required parameters (based on api)
      • Popup dialog
      • Providing feedback on input (validation) and when accepted, redirect to running page for the run that has commenced

      For the design (visual and more) of this, see the design ticket: https://issues.jenkins-ci.org/browse/JENKINS-38393

      Sample pipeline that requests all types of input that need to be supported:

      properties([parameters([booleanParam(defaultValue: false, description: 'this is bool', name: 'boolParam'), choice(choices: 'a\nb\nc', description: 'this is choice ', name: 'choiceThing'), text(defaultValue: 'defaultval', description: 'this is multiline', name: 'multiLIne'), password(defaultValue: 'nada', description: 'This is password', name: 'pass'), string(defaultValue: 'defaultparam', description: 'This is string param', name: 'stringParam')]), pipelineTriggers([])])
      
      echo "yeah"
      

      NOTE: to get jenkins to ask for input - you have to run this pipeline once to set the input required config in Jenkins. After that, the next time you run it, it will show the form in classic:

        Attachments

          Issue Links

            Activity

            Hide
            jamesdumay James Dumay added a comment -

            Brody Maclean add the input mockup here and redefined the description as you see fit then un-assign it

            Show
            jamesdumay James Dumay added a comment - Brody Maclean add the input mockup here and redefined the description as you see fit then un-assign it
            Hide
            brody Brody Maclean added a comment -

            Zeplin Link https://zpl.io/2bLMX6

            Mockup

            Show
            brody Brody Maclean added a comment - Zeplin Link https://zpl.io/2bLMX6 Mockup
            Hide
            jamesdumay James Dumay added a comment -

            Vivek Pandey for this one can we get all the params that were given to the pipeline? I'd like to display them somewhere like I've asked on https://issues.jenkins-ci.org/browse/JENKINS-40672?focusedCommentId=281378&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-281378

            Show
            jamesdumay James Dumay added a comment - Vivek Pandey for this one can we get all the params that were given to the pipeline? I'd like to display them somewhere like I've asked on https://issues.jenkins-ci.org/browse/JENKINS-40672?focusedCommentId=281378&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-281378
            Hide
            vivek Vivek Pandey added a comment -

            James Dumay Parameters are available only after run has started and the input steps (with parameters) are in paused state. Otherwise underlying pipeline/workflow libraries do not give any ways to get these parameter definitions. Sam Van Oort do you know any ways we can get them before and after run?

            Show
            vivek Vivek Pandey added a comment - James Dumay Parameters are available only after run has started and the input steps (with parameters) are in paused state. Otherwise underlying pipeline/workflow libraries do not give any ways to get these parameter definitions. Sam Van Oort do you know any ways we can get them before and after run?
            Hide
            svanoort Sam Van Oort added a comment -

            Vivek Pandey Nope, that's about the size of it – you have to capture the parameters if you want the record of their values. Otherwise you'd have to make changes to the input step itself if you wanted to track more.

            Show
            svanoort Sam Van Oort added a comment - Vivek Pandey Nope, that's about the size of it – you have to capture the parameters if you want the record of their values. Otherwise you'd have to make changes to the input step itself if you wanted to track more.
            Hide
            jamesdumay James Dumay added a comment -

            Thorsten Scherler FYI brody updated the mockups here.

            Show
            jamesdumay James Dumay added a comment - Thorsten Scherler FYI brody updated the mockups here.
            Hide
            tscherler Thorsten Scherler added a comment -

            The feature is ready however we need to implement some basic testing before we merge

            Show
            tscherler Thorsten Scherler added a comment - The feature is ready however we need to implement some basic testing before we merge
            Hide
            jamesdumay James Dumay added a comment -

            Can't wait to give it a go!!

            Show
            jamesdumay James Dumay added a comment - Can't wait to give it a go!!
            Hide
            nhhai Hai Nguyen added a comment - - edited

            Hi, I'm using Jenkins 2.46.1 with BlueOcean 1.0.1. My project has a declarative pipeline file look like:

            pipeline {
              agent any
            
              parameters {
                string(
                  name: 'test_include_groups',
                  defaultValue: '',
                  description: 'Comma separated groups of test that should be included.')
                string(
                  name: 'test_exclude_groups',
                  defaultValue: 'NonRegression,Failing,Invalid',
                  description: 'Comma separated groups of test that should be excluded.')
              }
            
              environment {
                ...
              }
            
              stages {
                ...
              }
            }
            
            

            I cannot figure out where is the manual trigger button for my project in BlueOcean UI. In the old UI I can do the followings:

            • Trigger build remotely with default parameters
            • Manually give input parameters and build manually

            Can someone show me how to achieve the same as aboveĀ in new BlueOcean UI? Does my Jenkinsfile correct to do that?

            Show
            nhhai Hai Nguyen added a comment - - edited Hi, I'm using Jenkins 2.46.1 with BlueOcean 1.0.1. My project has a declarative pipeline file look like: pipeline { agent any parameters { string( name: 'test_include_groups' , defaultValue: '', description: 'Comma separated groups of test that should be included.' ) string( name: 'test_exclude_groups' , defaultValue: 'NonRegression,Failing,Invalid' , description: 'Comma separated groups of test that should be excluded.' ) } environment { ... } stages { ... } } I cannot figure out where is the manual trigger button for my project in BlueOcean UI. In the old UI I can do the followings: Trigger build remotely with default parameters Manually give input parameters and build manually Can someone show me how to achieve the same as aboveĀ in new BlueOcean UI? Does my Jenkinsfile correct to do that?

              People

              • Assignee:
                tscherler Thorsten Scherler
                Reporter:
                michaelneale Michael Neale
              • Votes:
                4 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: