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

User can see the input form on an input step (UI)

    Details

    • Similar Issues:
    • Epic Link:
    • Sprint:
      frank, christmas

      Description

      In Scope

      • Step should show the "waiting for input" indicator.
      • Input form should be shown where the log is usually shown.
      • When the user clicks "Submit" the form disappears and the log for that step is shown (Note: progress via karaoke should resume at this point)
      • User cannot submit the form unless they have filled in all values.
      • We will need to show a form validation message if the user tries to submit the form with empty values.
      • The confirmation button label is "Continue"
      • The button in the header is "Abort" which aborts the run.
      • See https://issues.jenkins-ci.org/browse/JENKINS-35899 for details on the visual design of this and screen shots

      Before vivek left he was able to merge the first tranche of support for input.
      This is described in this closed PR here: https://github.com/jenkinsci/blueocean-plugin/pull/645 (with a sample pipeline, that will return states waiting for input)

      Creating the following pipeline and calling it "paused"

      node {
          stage("parallelStage"){
            parallel left : {
                  echo "running"
                  def branchInput = input message: 'Please input branch to test against', parameters: [[$class: 'StringParameterDefinition', defaultValue: 'master', description: '', name: 'branch']]
                  echo "BRANCH NAME: ${branchInput}"
              }, 
              right : {
                  sh 'sleep 100000'
              }
          }
      }
      

      Run it - and then go to the following URL:

      http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/paused/runs/1/steps/

      And you will see:

      {
      "_class": "io.jenkins.blueocean.rest.impl.pipeline.PipelineStepImpl",
      "_links": {},
      "actions": [],
      "displayName": "Wait for interactive input",
      "durationInMillis": 124735,
      "id": "12",
      "input": {
      "_class": "io.jenkins.blueocean.rest.impl.pipeline.InputStepImpl",
      "_links": {
      "self": {
      "_class": "io.jenkins.blueocean.rest.hal.Link",
      "href": "/blue/rest/organizations/jenkins/pipelines/paused/runs/1/steps/12/input/"
      }
      },
      "id": "C51b52435b43a326d5d4f92c290a64d5",
      "message": "Please input branch to test against",
      "ok": "Proceed",
      "parameters": [
      {
      "_class": "hudson.model.StringParameterDefinition",
      "defaultParameterValue": {
      "_class": "hudson.model.StringParameterValue",
      "name": "branch",
      "value": "master"
      },
      "description": "",
      "name": "branch",
      "type": "StringParameterDefinition"
      }
      ],
      "submitter": null
      },
      "result": "UNKNOWN",
      "startTime": "2016-12-13T15:32:28.343+1100",
      "state": "PAUSED"
      }
      

      We can come up with more canonical examples of all input types once familiar with the api:

      GET /jenkins/blue/rest/organizations/jenkins/pipelines/pipeline1/runs/1/ should report state==PAUSED, result==UNKNOWN
      GET /jenkins/blue/rest/organizations/jenkins/pipelines/pipeline1/runs/1/nodes/ should report state==PAUSED, result==UNKNOWN for nodes parallelStage and right.
      GET /jenkins/blue/rest/organizations/jenkins/pipelines/pipeline1/runs/1/steps/ should report state==PAUSED, result==UNKNOWN for step id 12

      When you drill into a step for a paused node you can see the input required:

      eg:
      http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/paused/runs/1/nodes/6/steps/12/

      Has an input value of:

      "input": {
      "_class": "io.jenkins.blueocean.rest.impl.pipeline.InputStepImpl",
      "_links": {
      "self": {
      "_class": "io.jenkins.blueocean.rest.hal.Link",
      "href": "/blue/rest/organizations/jenkins/pipelines/paused/runs/1/nodes/6/steps/12/input/"
      }
      },
      "id": "C51b52435b43a326d5d4f92c290a64d5",
      "message": "Please input branch to test against",
      "ok": "Proceed",
      "parameters": [
      {
      "_class": "hudson.model.StringParameterDefinition",
      "defaultParameterValue": {
      "_class": "hudson.model.StringParameterValue",
      "name": "branch",
      "value": "master"
      },
      "description": "",
      "name": "branch",
      "type": "StringParameterDefinition"
      }
      ],
      "submitter": null
      }
      
      

      which is what the form is rendered from.

        Attachments

          Issue Links

            Activity

            Hide
            brody Brody Maclean added a comment -

            Thorsten Scherler I had a poke around but didn't find a teal colour in any of the variables.less files on Github.
            Either way, they current teal is #24B0D5;

            Show
            brody Brody Maclean added a comment - Thorsten Scherler I had a poke around but didn't find a teal colour in any of the variables.less files on Github. Either way, they current teal is #24B0D5;
            Hide
            michaelneale Michael Neale added a comment -

            TODO: brody to confirm colours. Also - no need to add an element for credentials at this stage. Vivek to provide flowNode that can be posted to.

            Show
            michaelneale Michael Neale added a comment - TODO: brody to confirm colours. Also - no need to add an element for credentials at this stage. Vivek to provide flowNode that can be posted to.
            Hide
            brody Brody Maclean added a comment -

            2 - 6 choices – radio
            7+ – dropdown

            Show
            brody Brody Maclean added a comment - 2 - 6 choices – radio 7+ – dropdown
            Hide
            michaelneale Michael Neale added a comment - - edited

            Thorsten Scherler after talking with brody, we think that if there are 5 or less items in a "choice" - use radio button. if there are more than 5, use a drop down.

            EDIT: see brody screen shot below.

            Show
            michaelneale Michael Neale added a comment - - edited Thorsten Scherler after talking with brody, we think that if there are 5 or less items in a "choice" - use radio button. if there are more than 5, use a drop down. EDIT: see brody screen shot below.
            Hide
            tscherler Thorsten Scherler added a comment - - edited

            James Dumay you are talking about the new design. IMO we should place them correctly when we generally implement the new headers but not in this PR

            Just re-read your command. You refer to the dialog where we have the default "cancel" button and the ok which can contain custom caption

            Show
            tscherler Thorsten Scherler added a comment - - edited James Dumay you are talking about the new design. IMO we should place them correctly when we generally implement the new headers but not in this PR Just re-read your command. You refer to the dialog where we have the default "cancel" button and the ok which can contain custom caption

              People

              • Assignee:
                tscherler Thorsten Scherler
                Reporter:
                jamesdumay James Dumay
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: