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

Missing nodes in during input step with parallel jobs

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Blue Ocean 1.1

      Description

      Problem
      There appears to be a mismatch between what the Blue Ocean API returns that causes the UI to become disoriented and hide information when dealing with a specific scenario given this pipeline configuration.

      Jenkinsfile

      def envs = [
        [env: "stage", region: "us-east-1"]
      ]
      stage("Plan") {
        def planJobs = [:]
        for(int i = 0; i < envs.size(); i++) {
          def details = envs.get(i)
          planJobs["${details.env}-${details.region}"] = {
            node() {
              echo "Running!"
            }
          }
        }
        parallel(planJobs)
      }
      stage("Apply") {
        def applyJobs = [:]
        for(int i = 0; i < envs.size(); i++) {
          def details = envs.get(i)
          def confirmedUser = "Auto"
          applyJobs["${details.env}-${details.region}"] = {
            def apply = false
            try {
              confirmedUser = input message: 'Apply Plan?', ok: 'Apply', submitterParameter: 'confirmedUser'
              apply = true
            } catch (err) {
              apply = false
              currentBuild.result = 'ABORTED'
            }
            if(apply) {
              node() {
                echo "Applying! Confirmed by ${confirmedUser}"
              }
            }
          }
        }
        parallel(applyJobs)
      }
      

      Background
      We dynamically generate the parallel stages based on information passed into the pipeline (or read from a config file). This way we can run for a project-defined set of params, i.e "run this in stage and prod in the us-east and eu-central regions" or any mix/match of those kinds of parameters. 

      singles.json: A parallel job that has two sequential stages with an input in between (Plan - input - Apply)

      doubles.json: A parallel job that has two jobs running the same two sequential stages with only one waiting on input:

      You can see in the image with the single "Apply" stage, it is missing the plan view (the singles.json file is the API response for that view)

      The second screenshot shows what we expect to see in the single job (without the "prod-us-east-1" node).

        Attachments

          Activity

          plukevdh Luke van der Hoeven created issue -
          jamesdumay James Dumay made changes -
          Field Original Value New Value
          Assignee James Dumay [ jamesdumay ]
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.1 [ 321 ]
          jamesdumay James Dumay made changes -
          Rank Ranked lower
          jamesdumay James Dumay made changes -
          Description There appears to be a mismatch between what the Blue Ocean API returns that causes the UI to become disoriented and hide information when dealing with a specific scenario given this pipeline configuration: https://gist.github.com/d5ee63dbed6be37e6b3873a9426977c9&#xA0;

          A bit of background: We dynamically generate the parallel stages based on information passed into the pipeline (or read from a config file). This way we can run for a project-defined set of params, i.e "run this in stage and prod in the us-east and eu-central regions" or any mix/match of those kinds of parameters. 

          singles.json: A parallel job that has two sequential stages with an input in between (Plan - input - Apply)

          doubles.json: A parallel job that has two jobs running the same two sequential stages with only one waiting on input:

          You can see in the image with the single "Apply" stage, it is missing the plan view (the singles.json file is the API response for that view)

          The second screenshot shows what we expect to see in the single job (without the "prod-us-east-1" node).

          *Problem
          There appears to be a mismatch between what the Blue Ocean API returns that causes the UI to become disoriented and hide information when dealing with a specific scenario given this pipeline configuration.

          *Jenkinsfile*
          {code}
          def envs = [
            [env: "stage", region: "us-east-1"]
          ]
          stage("Plan") {
            def planJobs = [:]
            for(int i = 0; i < envs.size(); i++) {
              def details = envs.get(i)
              planJobs["${details.env}-${details.region}"] = {
                node() {
                  echo "Running!"
                }
              }
            }
            parallel(planJobs)
          }
          stage("Apply") {
            def applyJobs = [:]
            for(int i = 0; i < envs.size(); i++) {
              def details = envs.get(i)
              def confirmedUser = "Auto"
              applyJobs["${details.env}-${details.region}"] = {
                def apply = false
                try {
                  confirmedUser = input message: 'Apply Plan?', ok: 'Apply', submitterParameter: 'confirmedUser'
                  apply = true
                } catch (err) {
                  apply = false
                  currentBuild.result = 'ABORTED'
                }
                if(apply) {
                  node() {
                    echo "Applying! Confirmed by ${confirmedUser}"
                  }
                }
              }
            }
            parallel(applyJobs)
          }
          {code}

          *Background*
          We dynamically generate the parallel stages based on information passed into the pipeline (or read from a config file). This way we can run for a project-defined set of params, i.e "run this in stage and prod in the us-east and eu-central regions" or any mix/match of those kinds of parameters. 

          singles.json: A parallel job that has two sequential stages with an input in between (Plan - input - Apply)

          doubles.json: A parallel job that has two jobs running the same two sequential stages with only one waiting on input:

          You can see in the image with the single "Apply" stage, it is missing the plan view (the singles.json file is the API response for that view)

          The second screenshot shows what we expect to see in the single job (without the "prod-us-east-1" node).
          jamesdumay James Dumay made changes -
          Description
          *Problem
          There appears to be a mismatch between what the Blue Ocean API returns that causes the UI to become disoriented and hide information when dealing with a specific scenario given this pipeline configuration.

          *Jenkinsfile*
          {code}
          def envs = [
            [env: "stage", region: "us-east-1"]
          ]
          stage("Plan") {
            def planJobs = [:]
            for(int i = 0; i < envs.size(); i++) {
              def details = envs.get(i)
              planJobs["${details.env}-${details.region}"] = {
                node() {
                  echo "Running!"
                }
              }
            }
            parallel(planJobs)
          }
          stage("Apply") {
            def applyJobs = [:]
            for(int i = 0; i < envs.size(); i++) {
              def details = envs.get(i)
              def confirmedUser = "Auto"
              applyJobs["${details.env}-${details.region}"] = {
                def apply = false
                try {
                  confirmedUser = input message: 'Apply Plan?', ok: 'Apply', submitterParameter: 'confirmedUser'
                  apply = true
                } catch (err) {
                  apply = false
                  currentBuild.result = 'ABORTED'
                }
                if(apply) {
                  node() {
                    echo "Applying! Confirmed by ${confirmedUser}"
                  }
                }
              }
            }
            parallel(applyJobs)
          }
          {code}

          *Background*
          We dynamically generate the parallel stages based on information passed into the pipeline (or read from a config file). This way we can run for a project-defined set of params, i.e "run this in stage and prod in the us-east and eu-central regions" or any mix/match of those kinds of parameters. 

          singles.json: A parallel job that has two sequential stages with an input in between (Plan - input - Apply)

          doubles.json: A parallel job that has two jobs running the same two sequential stages with only one waiting on input:

          You can see in the image with the single "Apply" stage, it is missing the plan view (the singles.json file is the API response for that view)

          The second screenshot shows what we expect to see in the single job (without the "prod-us-east-1" node).
          *Problem*
          There appears to be a mismatch between what the Blue Ocean API returns that causes the UI to become disoriented and hide information when dealing with a specific scenario given this pipeline configuration.

          *Jenkinsfile*
          {code}
          def envs = [
            [env: "stage", region: "us-east-1"]
          ]
          stage("Plan") {
            def planJobs = [:]
            for(int i = 0; i < envs.size(); i++) {
              def details = envs.get(i)
              planJobs["${details.env}-${details.region}"] = {
                node() {
                  echo "Running!"
                }
              }
            }
            parallel(planJobs)
          }
          stage("Apply") {
            def applyJobs = [:]
            for(int i = 0; i < envs.size(); i++) {
              def details = envs.get(i)
              def confirmedUser = "Auto"
              applyJobs["${details.env}-${details.region}"] = {
                def apply = false
                try {
                  confirmedUser = input message: 'Apply Plan?', ok: 'Apply', submitterParameter: 'confirmedUser'
                  apply = true
                } catch (err) {
                  apply = false
                  currentBuild.result = 'ABORTED'
                }
                if(apply) {
                  node() {
                    echo "Applying! Confirmed by ${confirmedUser}"
                  }
                }
              }
            }
            parallel(applyJobs)
          }
          {code}

          *Background*
          We dynamically generate the parallel stages based on information passed into the pipeline (or read from a config file). This way we can run for a project-defined set of params, i.e "run this in stage and prod in the us-east and eu-central regions" or any mix/match of those kinds of parameters. 

          singles.json: A parallel job that has two sequential stages with an input in between (Plan - input - Apply)

          doubles.json: A parallel job that has two jobs running the same two sequential stages with only one waiting on input:

          You can see in the image with the single "Apply" stage, it is missing the plan view (the singles.json file is the API response for that view)

          The second screenshot shows what we expect to see in the single job (without the "prod-us-east-1" node).
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.1 [ 321 ] Blue Ocean 1.1, Blue Ocean 1.1 [ 321, 331 ]
          jamesdumay James Dumay made changes -
          Assignee James Dumay [ jamesdumay ] Vivek Pandey [ vivek ]
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.1, Blue Ocean 1.1 [ 321, 331 ] Blue Ocean 1.1 [ 321 ]
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.1 [ 321 ] Blue Ocean 1.1, Blue Ocean 1.2 [ 321, 326 ]
          jamesdumay James Dumay made changes -
          Rank Ranked higher
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.1, Blue Ocean 1.2 [ 321, 326 ] Blue Ocean 1.3, Blue Ocean 1.1 [ 296, 321 ]
          jamesdumay James Dumay made changes -
          Rank Ranked lower
          jamesdumay James Dumay made changes -
          Epic Link JENKINS-43953 [ 181485 ]
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.3-beta-2, Blue Ocean 1.1 [ 296, 321 ] Blue Ocean 1.4, Blue Ocean 1.1 [ 311, 321 ]
          jamesdumay James Dumay made changes -
          Rank Ranked higher
          jamesdumay James Dumay made changes -
          Sprint Blue Ocean 1.4, Blue Ocean 1.1 [ 311, 321 ] Blue Ocean 1.1 [ 321 ]
          jamesdumay James Dumay made changes -
          Rank Ranked higher

            People

            Assignee:
            vivek Vivek Pandey
            Reporter:
            plukevdh Luke van der Hoeven
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: