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

Post build steps appear in previous stage's steps

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • blueocean-plugin
    • None

      If(in declarative mode && last stages are parallel && you have a post{} pipeline block) {
          you don't see any of the post-build output, it's missing
      }
      

      Suggestion:
      Good DX would be; if in declarative mode, and you have defined a post{} pipeline block, then to create a stage named Post Build or something. It's consistent, predictable, very clear and clickable.

          [JENKINS-50449] Post build steps appear in previous stage's steps

          Paul Dragoonis created issue -
          Paul Dragoonis made changes -
          Description Original:
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          New: {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          Paul Dragoonis made changes -
          Description Original: {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          New: As per the screenshot below, the pipeline's post{} section isn't visible, you have to find one of the stages in the main pipeline and see some steps appended onto it. This is confusing DX

          As per classic Jenkins, there's a section rendered `Declarative: Post Actions` and you can drill down into there.

          I am expecting to see a section on BO with the same.

          What's the intent behind this ?

          {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          Paul Dragoonis made changes -
          Description Original: As per the screenshot below, the pipeline's post{} section isn't visible, you have to find one of the stages in the main pipeline and see some steps appended onto it. This is confusing DX

          As per classic Jenkins, there's a section rendered `Declarative: Post Actions` and you can drill down into there.

          I am expecting to see a section on BO with the same.

          What's the intent behind this ?

          {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          New: As per the screenshot below, the pipeline's post{} section isn't visible, you have to find one of the stages in the main pipeline and see some steps appended onto it. This is confusing DX

          As per classic Jenkins, there's a section rendered `Declarative: Post Actions` and you can drill down into there. I am expecting to see a section on BO with the same.

          PS: I never seen the `success` output only the always{} output

          What's the intent behind this ?

          {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          Paul Dragoonis made changes -
          Description Original: As per the screenshot below, the pipeline's post{} section isn't visible, you have to find one of the stages in the main pipeline and see some steps appended onto it. This is confusing DX

          As per classic Jenkins, there's a section rendered `Declarative: Post Actions` and you can drill down into there. I am expecting to see a section on BO with the same.

          PS: I never seen the `success` output only the always{} output

          What's the intent behind this ?

          {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          New: As per the screenshot below, the pipeline's post{} section isn't visible, you have to find one of the stages in the main pipeline and see some steps appended onto it. This is confusing DX

          As per classic Jenkins, there's a section rendered `Declarative: Post Actions` and you can drill down into there. I am expecting to see a section on BO with the same.

          What's the intent behind this ?

          {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          Paul Dragoonis made changes -
          Issue Type Original: Improvement [ 4 ] New: Bug [ 1 ]
          Paul Dragoonis made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]
          Paul Dragoonis made changes -
          Description Original: As per the screenshot below, the pipeline's post{} section isn't visible, you have to find one of the stages in the main pipeline and see some steps appended onto it. This is confusing DX

          As per classic Jenkins, there's a section rendered `Declarative: Post Actions` and you can drill down into there. I am expecting to see a section on BO with the same.

          What's the intent behind this ?

          {code}
          pipeline {

            agent { label '!master' } // run on slaves only

            stages {
                stage('Some stage') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 2') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
                stage('Some stage 3') {
                    steps {
                        echo 'SOME MAIN STAGE'
                    }
                }
            }

            post {
              always {
                script {
                    echo "THIS IS POST TRIGGER STAGE"
                }
              }
              success {
                  script {
                      echo "THIS IS SUCCESS"
                  }
              }
            }

          }
          {code}
          New: If(in declarative mode && last stages are parallel && you have a post{} pipeline block) {
              you don't see any of the post-build output, it's missing
          }

          Suggestion:
          Good DX would be; if in declarative mode, and you have defined a post{} pipeline block, then to create a stage named Post Build or something. It's consistent, predictable, very clear and clickable.

          Paul Dragoonis made changes -
          Attachment Original: Screen Shot 2018-03-28 at 11.21.48.png [ 41996 ]
          Paul Dragoonis made changes -
          Attachment New: Screen Shot 2018-03-29 at 18.42.49.png [ 42020 ]
          Paul Dragoonis made changes -
          Description Original: If(in declarative mode && last stages are parallel && you have a post{} pipeline block) {
              you don't see any of the post-build output, it's missing
          }

          Suggestion:
          Good DX would be; if in declarative mode, and you have defined a post{} pipeline block, then to create a stage named Post Build or something. It's consistent, predictable, very clear and clickable.

          New: {code}
          If(in declarative mode && last stages are parallel && you have a post{} pipeline block) {
              you don't see any of the post-build output, it's missing
          }
          {code}

          Suggestion:
          Good DX would be; if in declarative mode, and you have defined a post{} pipeline block, then to create a stage named Post Build or something. It's consistent, predictable, very clear and clickable.

            Unassigned Unassigned
            dragoonis Paul Dragoonis
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: