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

nested Parallel in declarative results in temporary misrendering

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We're using a declarative pipeline that happens to use

      def {}
      // and
      script {} 
      // and
      parallel objects
      def projectName(projectPrefix, flavor) {
          return "${projectPrefix} ${flavor}"
      }
      def templateProjectNode (project, flavor, publish) {
          return {
              node {
                  stage(projectName(project, flavor)) {
                      try {
                          sh "hostname"
                          script {
                              sh label: "Compile + Test + Publish", script: "hostname"
                          }
                      }
                      finally {
                          junit "*/target/test-reports/**/*.xml"
                          archiveArtifacts "*/target/test-reports/**"
                          archiveArtifacts "*/target/*/*report/**"
                      }
                  }
              }
           }
      }
      def generateProjects (projectList) {
          def projects = projectList.collectEntries {
              [(projectName(it[0], it[1])): templateProjectNode(it[0], it[1], it[2])]
          }
          parallel projects
      }
      
      pipeline {
          stages {
              stage("a") {
                  steps {
                      sh "hostname"
                  }
              }
              stage("b") {
                  steps {
                      sh "hostname"
                  }
              }
              stage("c") {
                  steps {
                      sh "hostname"
                  }
              }
              stage("Compile + Test + Publish") {
                  parallel {
                      stage("Frontend") {
                          steps {
                              sh "hostname"
                          }
                      }
                      stage("Magic") {
                          steps {
                              script {
                                  projectList = [
                                      ["D", "QQ", true],
                                      ["D", "RR", true],
                                      ["E", "QQ", true],
                                      ["F", "QQ", true],
                                      ["F", "RR", true],
                                      ["G", "QQ", true],
                                      ["H", "QQ", false],
                                  ]
                                  generateProjects(projectList)
                              }
                          }
                      }
                  }
              }
              stage("j") {
                  steps {
                      sh "hostname"
                  }
              }
              stage("k") {
                  steps {
                      sh "hostname"
                  }
              }
              stage("l") {
                  when {
                      branch "master"
                  }
                  steps {
                      sh "hostname"
                  }
              }
          }
      }
       

       

      Expected results:

      the graph should generally have the same shape as the final graph. The first graph is perhaps the most problematic, although the second is also wrong.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jsoref Josh Soref
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: