• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • blueocean-plugin
    • None

      The scenario works fine for the scripted pipeline but the same fails in the declarative pipeline

      scripted pipeline

      {{def j=[:]
      node \{
          [
              [name: "api", folder: "api"],
              [name: "ui", folder: "ui"]
          ].each { m -> 
              j[m.name] = {
                  stage('a') {
                      echo "A"
                  }
                  stage('b') \{
                      echo "B"
                  }
              }
          }
          parallel j
      }}}
      

       

      declarative pipeline

       

      {{pipeline \{
          agent any;
          stages {
              stage("parallel") {
                  steps {
                      script {
                          def j=[:]
                          [
                              [name: "api", folder: "api"],
                              [name: "ui", folder: "ui"]
                          ].each { m -> 
                              j[m.name] = {
                                  stage('a') {
                                      echo "A"
                                  }
                                  stage('b') \{
                                      echo "B"
                                  }
                              }
                          }
                          parallel j
                      }
                  }
              }
          }
      }}}

      All the stages run but are not displayed.

      See related Stackoverflow question.

      Seems related to JENKINS-49050

          [JENKINS-64822] Parallel stages not displayed correctly

          javydreamercsw created issue -
          javydreamercsw made changes -
          Description Original: The scenario works fine for the scripted pipeline but the same fails in the declarative pipeline

          *scripted pipeline*
          {code:groovy}
          {{def j=[:]
          node \{
              [
                  [name: "api", folder: "api"],
                  [name: "ui", folder: "ui"]
              ].each { m ->
                  j[m.name] = {
                      stage('a') {
                          echo "A"
                      }
                      stage('b') \{
                          echo "B"
                      }
                  }
              }
              parallel j
          }}}
          {code}
            !script.png!

          *declarative pipeline*

           
          {code:groovy}
          {{pipeline \{
              agent any;
              stages {
                  stage("parallel") {
                      steps {
                          script {
                              def j=[:]
                              [
                                  [name: "api", folder: "api"],
                                  [name: "ui", folder: "ui"]
                              ].each { m ->
                                  j[m.name] = {
                                      stage('a') {
                                          echo "A"
                                      }
                                      stage('b') \{
                                          echo "B"
                                      }
                                  }
                              }
                              parallel j
                          }
                      }
                  }
              }
          }}}{code}
          !declarative.png!

          See related [Stackoverflow|https://stackoverflow.com/questions/66106234/jenkins-dynamic-pipeline-not-showing-all-stages-in-blueocean?noredirect=1#comment116876292_66106234] question.

          Seems related to JENKINS-49050
          New: The scenario works fine for the scripted pipeline but the same fails in the declarative pipeline

          *scripted pipeline*
          {code:groovy}
          {{def j=[:]
          node \{
              [
                  [name: "api", folder: "api"],
                  [name: "ui", folder: "ui"]
              ].each { m ->
                  j[m.name] = {
                      stage('a') {
                          echo "A"
                      }
                      stage('b') \{
                          echo "B"
                      }
                  }
              }
              parallel j
          }}}
          {code}
            !script.png!

          *declarative pipeline*

           
          {code:groovy}
          {{pipeline \{
              agent any;
              stages {
                  stage("parallel") {
                      steps {
                          script {
                              def j=[:]
                              [
                                  [name: "api", folder: "api"],
                                  [name: "ui", folder: "ui"]
                              ].each { m ->
                                  j[m.name] = {
                                      stage('a') {
                                          echo "A"
                                      }
                                      stage('b') \{
                                          echo "B"
                                      }
                                  }
                              }
                              parallel j
                          }
                      }
                  }
              }
          }}}{code}
          !declarative.png!

          All the stages run but are not displayed.

          See related [Stackoverflow|https://stackoverflow.com/questions/66106234/jenkins-dynamic-pipeline-not-showing-all-stages-in-blueocean?noredirect=1#comment116876292_66106234] question.

          Seems related to JENKINS-49050
          Anthony Veckey made changes -
          Attachment New: image-2024-06-17-11-11-52-226.png [ 62735 ]

            Unassigned Unassigned
            javydreamercsw javydreamercsw
            Votes:
            9 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: