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

Re-triggering a failed build copies the Actions from previous builds

      Steps to reproduce:

      1. Create a build pipeline with at least two stages, the second of which adds Actions to a build. For example, the git-plugin will attach a hudson.plugins.git.GitTagAction to the build to say what revision was built.
      2. Run the pipeline
      3. Re-run the second stage of the pipeline

      Expect:

      1. One actions in the summary page of the build from the git plugin

      Observe:

      1. Two actions! The previous builds action and the current builds (see attached screenshot)

      Marking as major because this results in breaking the TestNG publisher plugin - it relies on actions being persisted in builds to show reports and trend data. When actions are copied, the data is corrupted, and trends are overridden. This could potentially break other plugins in the pipeline as well.

          [JENKINS-30801] Re-triggering a failed build copies the Actions from previous builds

          Dan Alvizu added a comment -

          Some search terms to help other folks:

          • duplicate git build data / multiple git build data
          • duplicate git revision / multiple git revision
          • duplicate testng results
          • testng results overridden in build pipeline

          Dan Alvizu added a comment - Some search terms to help other folks: duplicate git build data / multiple git build data duplicate git revision / multiple git revision duplicate testng results testng results overridden in build pipeline

          Dan Alvizu added a comment -

          Dan Alvizu added a comment - PR: https://github.com/jenkinsci/build-pipeline-plugin/pull/89

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          .gitignore
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/8357d741b51ada7ad68d810b49871d6ff21b1bea
          Log:
          JENKINS-30801 limit Action objects in re-trigger to CauseAction

          Passing all Action objects from previous builds results in unexpected
          behavior: certain publisher and Builder rely on them to publish
          information about the build, and should not be copied to the next build.

          The only reason to copy Action objects is to preserve the cause of the build
          in order to keep it in the pipeline and replay how the build was triggered.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: .gitignore src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java http://jenkins-ci.org/commit/build-pipeline-plugin/8357d741b51ada7ad68d810b49871d6ff21b1bea Log: JENKINS-30801 limit Action objects in re-trigger to CauseAction Passing all Action objects from previous builds results in unexpected behavior: certain publisher and Builder rely on them to publish information about the build, and should not be copied to the next build. The only reason to copy Action objects is to preserve the cause of the build in order to keep it in the pipeline and replay how the build was triggered.

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          pom.xml
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          src/main/webapp/js/build-pipeline.js
          src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/5584922b17cb0e253fe4c9c04677bd3c3995e247
          Log:
          JENKINS-30801 add unit test, update javadoc, remove unused JS

          Remove 'retryBuild' JS - this is no longer used by any clients, it appears
          to have been removed in a refactor in JENKINS-22210.

          retryBuild functionality would retrigger the build but without any of the
          upstream cause maintained - it will only work for starting a new pipeline
          so nothing is really being retried.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: pom.xml src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java src/main/webapp/js/build-pipeline.js src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java http://jenkins-ci.org/commit/build-pipeline-plugin/5584922b17cb0e253fe4c9c04677bd3c3995e247 Log: JENKINS-30801 add unit test, update javadoc, remove unused JS Remove 'retryBuild' JS - this is no longer used by any clients, it appears to have been removed in a refactor in JENKINS-22210 . retryBuild functionality would retrigger the build but without any of the upstream cause maintained - it will only work for starting a new pipeline so nothing is really being retried.

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/13fa2c972bbd156460e5515b3e23b1445cd907bb
          Log:
          JENKINS-30801 Copy over ParametersAction as well

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java http://jenkins-ci.org/commit/build-pipeline-plugin/13fa2c972bbd156460e5515b3e23b1445cd907bb Log: JENKINS-30801 Copy over ParametersAction as well

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/trigger/BuildPipelineTriggerTest.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/702b877b7ef9f8b1aa64247b4ad8c215bf76d344
          Log:
          [FIXED JENKINS-30801] Fix missing UpstreamCause

          UpstreamCause was being removed if it contained a UserIdCause.
          We really only want to remove the UserIdCause itself, and preserve
          the rest of the CauseAction to save upstream / downstream
          relationships.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/trigger/BuildPipelineTriggerTest.java http://jenkins-ci.org/commit/build-pipeline-plugin/702b877b7ef9f8b1aa64247b4ad8c215bf76d344 Log: [FIXED JENKINS-30801] Fix missing UpstreamCause UpstreamCause was being removed if it contained a UserIdCause. We really only want to remove the UserIdCause itself, and preserve the rest of the CauseAction to save upstream / downstream relationships.

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/439eeab2f7060fd542b47c95da1303ec01946ad0
          Log:
          JENKINS-30801 checkstyle fixes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java http://jenkins-ci.org/commit/build-pipeline-plugin/439eeab2f7060fd542b47c95da1303ec01946ad0 Log: JENKINS-30801 checkstyle fixes

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/fb49ded545db776497cd0692d0032cad40ff3fab
          Log:
          JENKINS-30801 fix ConcurrentModificationException, add test

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java http://jenkins-ci.org/commit/build-pipeline-plugin/fb49ded545db776497cd0692d0032cad40ff3fab Log: JENKINS-30801 fix ConcurrentModificationException, add test

          Code changed in jenkins
          User: Dan Alvizu
          Path:
          .gitignore
          pom.xml
          src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java
          src/main/webapp/js/build-pipeline.js
          src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java
          src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/trigger/BuildPipelineTriggerTest.java
          http://jenkins-ci.org/commit/build-pipeline-plugin/c05598dfef7dc2258e111e64de2a470e1df6d98f
          Log:
          Merge pull request #89 from dalvizu/JENKINS-30801-2

          [Fixed JENKINS-30801]

          Compare: https://github.com/jenkinsci/build-pipeline-plugin/compare/11ce036fb7fa...c05598dfef7d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dan Alvizu Path: .gitignore pom.xml src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView.java src/main/webapp/js/build-pipeline.js src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewTest.java src/test/java/au/com/centrumsystems/hudson/plugin/buildpipeline/trigger/BuildPipelineTriggerTest.java http://jenkins-ci.org/commit/build-pipeline-plugin/c05598dfef7dc2258e111e64de2a470e1df6d98f Log: Merge pull request #89 from dalvizu/ JENKINS-30801 -2 [Fixed JENKINS-30801] Compare: https://github.com/jenkinsci/build-pipeline-plugin/compare/11ce036fb7fa...c05598dfef7d

            dalvizu Dan Alvizu
            dalvizu Dan Alvizu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: