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

postBuild and notifications shouldn't be stages

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      with postBuild being a stage, this results in a confusing experience.

      User is used to seeing:

      A->B->C->postBuild steps

      Should things fail on A, they will see:

      A->postBuild

      This hides the fact there are other stages that would normally be executed.
      For stage view, and blue ocean, this can result in a visual report of:

      A->postBuild->B (skipped) -> C (skipped)

      which is very confusing.

      So either postBuild steps should be rolled into the final stage that was executed (acceptable) or else if there is a failure, all subsequent stages have to be reported (but with no steps in them) so that the presentation is consistent (former is easier and clearer).

      I believe James Dumay will be able to explain more.

      The bottom line is by making postBuild a synthetic stage, the structure of the pipeline radically changes depending on success of failure (vs just being early terminated).

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            Huhhhh. Interesting. I'd actually tend towards the latter (empty stages for stages that should have run but didn't due to the failed build) and preserving postBuild and notifications as synthetic stages. It's easy enough to do. In fact, I'm gonna bang out a PR implementing that now. =)

            Show
            abayer Andrew Bayer added a comment - Huhhhh. Interesting. I'd actually tend towards the latter (empty stages for stages that should have run but didn't due to the failed build) and preserving postBuild and notifications as synthetic stages. It's easy enough to do. In fact, I'm gonna bang out a PR implementing that now. =)
            Hide
            abayer Andrew Bayer added a comment -

            PR up https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/11 - changes to execute empty stages for post-failure stages. Thoughts desired. =)

            Show
            abayer Andrew Bayer added a comment - PR up https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/11 - changes to execute empty stages for post-failure stages. Thoughts desired. =)
            Hide
            michaelneale Michael Neale added a comment -

            Andrew Bayer yes returning "empty" stages for things that should have run is preferable. Makes things clearer when looking at a single execution too (ie how much of the pipeline is to go).

            Show
            michaelneale Michael Neale added a comment - Andrew Bayer yes returning "empty" stages for things that should have run is preferable. Makes things clearer when looking at a single execution too (ie how much of the pipeline is to go).
            Hide
            abayer Andrew Bayer added a comment -

            Merged!

            Show
            abayer Andrew Bayer added a comment - Merged!
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
            src/test/resources/allStagesExist.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/bbd9bc51787f8faa2a2a953627a4d242c9af19d0
            Log:
            JENKINS-38097 Run empty stages for post-failure stages.

            To ensure that we always have the same stage execution order
            (including the synthetic postBuild/notification stages), we now switch
            to still running stages after a failure, but not running anything in
            them. I don't know if there's some way we can set those post-failure
            stages as "skipped"?

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java src/test/resources/allStagesExist.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/bbd9bc51787f8faa2a2a953627a4d242c9af19d0 Log: JENKINS-38097 Run empty stages for post-failure stages. To ensure that we always have the same stage execution order (including the synthetic postBuild/notification stages), we now switch to still running stages after a failure, but not running anything in them. I don't know if there's some way we can set those post-failure stages as "skipped"?
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
            src/test/resources/allStagesExist.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/15079563fca0f5eb688510bacc6086b7e2fefbed
            Log:
            Merge pull request #11 from abayer/jenkins-38097

            JENKINS-38097 Run empty stages for post-failure stages.

            Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/4604f74b3b80...15079563fca0

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java src/test/resources/allStagesExist.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/15079563fca0f5eb688510bacc6086b7e2fefbed Log: Merge pull request #11 from abayer/jenkins-38097 JENKINS-38097 Run empty stages for post-failure stages. Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/4604f74b3b80...15079563fca0

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                michaelneale Michael Neale
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: