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

Upstream build points to wrong revision if there is more than one revision triggered the job

      I'm having a setup with two matrix job: an upstream job, which compiles my binaries and a downstream job, which executes the test suite using the binaries from the upstream job.
      The test job is much slower than the build job obviously.
      I noticed the following scenarion:
      In my upstream job I got two commit with only a small timegap, so the two build job was queued after each other, and after that, I got one test job queued, having by triggered both upstream job:
      Started by upstream project php-src-trunk-matrix-build build number 87

      Started by upstream project php-src-trunk-matrix-build build number 88

      when the downstream build started, the copy artifact plugin copied the artifacts from the upstream build #87, not from #88, but the same SCM(subversion btw.) version was used as in upstream #88 which means that it run a different version of the binary and the testsuite, hence my testsuite failed.

      Is there a chance that copyartifact could watch out for multiple triggers and use the latest build version number?

          [JENKINS-11655] Upstream build points to wrong revision if there is more than one revision triggered the job

          heinzepreller added a comment -

          I'm having a similar problem that the copy artifacts plugin copies 2 artifacts versions if it as a build job that is triggered by other projects. Therefore i have to manually delete the workspace and build again. Problem occured after updating from version 1.435 to 1.438.

          heinzepreller added a comment - I'm having a similar problem that the copy artifacts plugin copies 2 artifacts versions if it as a build job that is triggered by other projects. Therefore i have to manually delete the workspace and build again. Problem occured after updating from version 1.435 to 1.438.

          ikedam added a comment -

          Let me know details of "but the same SCM(subversion btw.) version was used as in upstream #88 which means that it run a different version of the binary and the testsuite, hence my testsuite failed."
          That sounds mean there are difference between behaviors of copyartifact and SCM, but I cannot see that's a case for all SCM plugins (svn, git, etc) or only for svn.

          ikedam added a comment - Let me know details of "but the same SCM(subversion btw.) version was used as in upstream #88 which means that it run a different version of the binary and the testsuite, hence my testsuite failed." That sounds mean there are difference between behaviors of copyartifact and SCM, but I cannot see that's a case for all SCM plugins (svn, git, etc) or only for svn.

          Code changed in jenkins
          User: Sivonen Kari Matti Juhani
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          http://jenkins-ci.org/commit/copyartifact-plugin/724b5ab74ef9f5d56713d99e2bcd0a4d6e69d118
          Log:
          JENKINS-11655: If many builds trigger same downstream job, wrong artifacts are copied, first job triggered, not last / newest like would be assumed. In this commit it is fixed.

          Because this is a big changes it may be reasonable to have some global configuration checkbox if used newestbuild instead of first build when artifacts are copied. I tried to do it also, but my competence was not enough. Those tries are in comment in this commit.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sivonen Kari Matti Juhani Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java http://jenkins-ci.org/commit/copyartifact-plugin/724b5ab74ef9f5d56713d99e2bcd0a4d6e69d118 Log: JENKINS-11655 : If many builds trigger same downstream job, wrong artifacts are copied, first job triggered, not last / newest like would be assumed. In this commit it is fixed. Because this is a big changes it may be reasonable to have some global configuration checkbox if used newestbuild instead of first build when artifacts are copied. I tried to do it also, but my competence was not enough. Those tries are in comment in this commit.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/config.jelly
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-useNewest.html
          http://jenkins-ci.org/commit/copyartifact-plugin/3d52bd573c5c3fbec6639674dc570ba4636c098f
          Log:
          JENKINS-11655 Added a parameter to specify whether use the newest upstream or the oldest one. Also supports cascaded triggering.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/config.jelly src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-useNewest.html http://jenkins-ci.org/commit/copyartifact-plugin/3d52bd573c5c3fbec6639674dc570ba4636c098f Log: JENKINS-11655 Added a parameter to specify whether use the newest upstream or the oldest one. Also supports cascaded triggering.

          Code changed in jenkins
          User: ikedam
          Path:
          src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java
          src/test/java/hudson/plugins/copyartifact/testutils/FileWriteBuilder.java
          http://jenkins-ci.org/commit/copyartifact-plugin/1addda5e035e2d352f1fc9bf899474a1972fc637
          Log:
          JENKINS-11655 Added tests for the upstream selecting feature of TriggeredBuildSelector. Though existing tests of TriggeredBuildSelector are in CopyArtifactTest, I created a new test class as adding tests are so complicated and large.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java src/test/java/hudson/plugins/copyartifact/testutils/FileWriteBuilder.java http://jenkins-ci.org/commit/copyartifact-plugin/1addda5e035e2d352f1fc9bf899474a1972fc637 Log: JENKINS-11655 Added tests for the upstream selecting feature of TriggeredBuildSelector. Though existing tests of TriggeredBuildSelector are in CopyArtifactTest, I created a new test class as adding tests are so complicated and large.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          src/main/resources/hudson/plugins/copyartifact/Messages.properties
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/config.jelly
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/global.jelly
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-globalUpstreamFilterStrategy.html
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-upstreamFilterStrategy.html
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-useNewest.html
          http://jenkins-ci.org/commit/copyartifact-plugin/a99e78e65f4dc102f6706ab14f25d49d204646e2
          Log:
          JENKINS-11655 Added global configuration to specify the default behavior.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java src/main/resources/hudson/plugins/copyartifact/Messages.properties src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/config.jelly src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/global.jelly src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-globalUpstreamFilterStrategy.html src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-upstreamFilterStrategy.html src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-useNewest.html http://jenkins-ci.org/commit/copyartifact-plugin/a99e78e65f4dc102f6706ab14f25d49d204646e2 Log: JENKINS-11655 Added global configuration to specify the default behavior.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java
          http://jenkins-ci.org/commit/copyartifact-plugin/6f80d6ca29c6c336c4b7a0eb60aa3a41ddfa1df5
          Log:
          JENKINS-11655 Updates tests against adding globalUpstreamFilterStrategy

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/6f80d6ca29c6c336c4b7a0eb60aa3a41ddfa1df5 Log: JENKINS-11655 Updates tests against adding globalUpstreamFilterStrategy

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          src/main/resources/hudson/plugins/copyartifact/Messages.properties
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/config.jelly
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/global.jelly
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-globalUpstreamFilterStrategy.html
          src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-upstreamFilterStrategy.html
          src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java
          src/test/java/hudson/plugins/copyartifact/testutils/FileWriteBuilder.java
          http://jenkins-ci.org/commit/copyartifact-plugin/e894206e94ca67b6067990febeb860672dc30bb1
          Log:
          Merge pull request #39 from ikedam/feature/JENKINS-11655_NewestUpstream

          JENKINS-11655 Use the newest upstream

          Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/b33ceb5d1cd5...e894206e94ca

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java src/main/resources/hudson/plugins/copyartifact/Messages.properties src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/config.jelly src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/global.jelly src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-globalUpstreamFilterStrategy.html src/main/resources/hudson/plugins/copyartifact/TriggeredBuildSelector/help-upstreamFilterStrategy.html src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java src/test/java/hudson/plugins/copyartifact/testutils/FileWriteBuilder.java http://jenkins-ci.org/commit/copyartifact-plugin/e894206e94ca67b6067990febeb860672dc30bb1 Log: Merge pull request #39 from ikedam/feature/ JENKINS-11655 _NewestUpstream JENKINS-11655 Use the newest upstream Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/b33ceb5d1cd5...e894206e94ca

          ikedam added a comment -

          Released the fix in copyartifact 1.31.
          It will be available in a day.

          ikedam added a comment - Released the fix in copyartifact 1.31. It will be available in a day.

            ikedam ikedam
            tyrael Ferenc Kovacs
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: