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

Jenkins kicks off the wrong downstream builds for Maven

      Given: Jenkins has different build jobs with different versions of the same artifacts and group ids. Example jarProj-1.1 and jarProj-1.2, and dependent builds warProj-1.1 and warProj-1.2.

      Problem: When Jenkins determines downstream build jobs, it is choosing ALL versions of old and current jobs. So in the example, jarProj-1.2 kicks off BOTH warProj-1.2 (correct) AND warProj1.1 (incorrect). Also, jarProj-1.1 kicks off no builds at all (incorrect), when instead we expect it to kick off warProj-1.1.

      Seems related to JENKINS-15295. We have the same fingerprint errors.

      Also, JENKINS-12735 made a change to cover version ranges in Maven, and that seems like it would break the downstream builds if a bug was introduced there.

          [JENKINS-15367] Jenkins kicks off the wrong downstream builds for Maven

          Larry Shatzer, Jr. added a comment - See this thread https://groups.google.com/forum/?fromgroups=#!topic/jenkinsci-dev/sPD02rg0ZCQ

          Marco Rothe added a comment - - edited

          It seems to be related to (or a dublicate of) 15237.

          This is a real blocker for us and we downgraded to 1.480.

          Marco Rothe added a comment - - edited It seems to be related to (or a dublicate of) 15237. This is a real blocker for us and we downgraded to 1.480.

          Alex Koon added a comment -

          I have traced this issue as part of

          https://issues.jenkins-ci.org/browse/JENKINS-12735

          I have added a test case to MavenModuleTest to show this and a fix for this in ModuleDependency. I have pushed this to my fork on github at

          https://github.com/alexkoon/jenkins

          and the commit is at

          https://github.com/alexkoon/jenkins/commit/4043905580df5bf22cde0eaf3dec103abdc88017

          I can issue a pull request for this if you wish.

          Alex Koon added a comment - I have traced this issue as part of https://issues.jenkins-ci.org/browse/JENKINS-12735 I have added a test case to MavenModuleTest to show this and a fix for this in ModuleDependency. I have pushed this to my fork on github at https://github.com/alexkoon/jenkins and the commit is at https://github.com/alexkoon/jenkins/commit/4043905580df5bf22cde0eaf3dec103abdc88017 I can issue a pull request for this if you wish.

          Hi,
          I did try out your fork, and it seems to work fine for my scenarios. (i.e. direct snapshot dependencies got triggered, other versions didn't)

          Michael Glauche added a comment - Hi, I did try out your fork, and it seems to work fine for my scenarios. (i.e. direct snapshot dependencies got triggered, other versions didn't)

          Erik Riemers added a comment -

          Would be nice to see this in 1.491 or newer.

          Erik Riemers added a comment - Would be nice to see this in 1.491 or newer.

          Code changed in jenkins
          User: alexkoon
          Path:
          maven-plugin/src/main/java/hudson/maven/ModuleDependency.java
          maven-plugin/src/test/java/hudson/maven/MavenModuleTest.java
          http://jenkins-ci.org/commit/jenkins/4043905580df5bf22cde0eaf3dec103abdc88017
          Log:
          JENKINS-15367 Fix for downstream dependencies when we have a specified version (not a version range).

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: alexkoon Path: maven-plugin/src/main/java/hudson/maven/ModuleDependency.java maven-plugin/src/test/java/hudson/maven/MavenModuleTest.java http://jenkins-ci.org/commit/jenkins/4043905580df5bf22cde0eaf3dec103abdc88017 Log: JENKINS-15367 Fix for downstream dependencies when we have a specified version (not a version range).

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven-plugin/src/main/java/hudson/maven/ModuleDependency.java
          maven-plugin/src/test/java/hudson/maven/MavenModuleTest.java
          http://jenkins-ci.org/commit/jenkins/2c469b37b563c5d6ca70ac7841897e1a20083130
          Log:
          Merge pull request #609 from alexkoon/master

          JENKINS-15367 Fix Maven downstream resolution when declared as a specific version.

          Compare: https://github.com/jenkinsci/jenkins/compare/7bf6c5ca6e09...2c469b37b563

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven-plugin/src/main/java/hudson/maven/ModuleDependency.java maven-plugin/src/test/java/hudson/maven/MavenModuleTest.java http://jenkins-ci.org/commit/jenkins/2c469b37b563c5d6ca70ac7841897e1a20083130 Log: Merge pull request #609 from alexkoon/master JENKINS-15367 Fix Maven downstream resolution when declared as a specific version. Compare: https://github.com/jenkinsci/jenkins/compare/7bf6c5ca6e09...2c469b37b563

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/2dbf8c5bce22f557834f5802cc379566addb9b7a
          Log:
          changelog entry for JENKINS-15367

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/2dbf8c5bce22f557834f5802cc379566addb9b7a Log: changelog entry for JENKINS-15367

          For me it seems to see itself somehow though version ranges (caused by cyclic dependencies I guess) and stays forever in 'pending - Upstream Job ... in build queue'. This might be more related to JENKINS-12735 because it started to happen at the same time that (upstream and) downstream builds started to contain version ranged dependencies. Funny thing is that the project itself isn't listed in upstream builds.

          tuomas_kiviaho added a comment - For me it seems to see itself somehow though version ranges (caused by cyclic dependencies I guess) and stays forever in 'pending - Upstream Job ... in build queue'. This might be more related to JENKINS-12735 because it started to happen at the same time that (upstream and) downstream builds started to contain version ranged dependencies. Funny thing is that the project itself isn't listed in upstream builds.

          The problem always exists in 1.491
          To reproduce add these 2 projects in your jenkins :

          Arnaud Héritier added a comment - The problem always exists in 1.491 To reproduce add these 2 projects in your jenkins : https://github.com/vietj/chromattic https://github.com/vietj/wikbook Wikbook builds will trigger chromattic builds while chromattic uses a released version of wikbook

          This was committed after the 1.491 RC branch was created, and was not backported into the RC branch unfortunately. It will be in 1.492.

          Larry Shatzer, Jr. added a comment - This was committed after the 1.491 RC branch was created, and was not backported into the RC branch unfortunately. It will be in 1.492.

          Successfully tested on 1.491 with a cherry-pick of 4043905580df5bf22cde0eaf3dec103abdc88017

          I tried with https://github.com/nuxeo/nuxeo-common/ and https://github.com/nuxeo/nuxeo-runtime/ with their "master" and "5.6.0" branches.
          I couldn't try much more with https://github.com/vietj/chromattic and https://github.com/vietj/wikbook because of build issues but it seems fine on the POM parsing part.

          Before the fix, nuxeo-common master (version 5.7-SNAPSHOT) was triggering nuxeo-runtime master (version 5.7-SNAPSHOT) and 5.6.0 (version 5.6.0-HF04-SNAPSHOT), whereas nuxeo-common 5.6.0 was triggering nothing at all.
          Note I didn't try to reproduce the issue with chromattic and wikbook before the fix.

          However, even if the triggering is fixed, I still have an issue (I don't know if it's exactly the same issue):

          • relationship between builds is sticked at builds earlier the fix
          • if there was no build before the fix, then the relationship is empty

          I'm talking about jenkins/projectRelationship?lhs=nuxeo-common-5.6.0&rhs=nuxeo-runtime-5.6.0 and jenkins/projectRelationship?lhs=nuxeo-common-master&rhs=nuxeo-runtime-master
          Before 1.480, the relationship is right.
          Since 1.481 until 1.491, without the current fix, the relationship seems still right even if triggering is wrong (see comment-168178 on JENKINS-15237).
          With the current fix applied on 1.491, the relationship is no more updated (new builds are ignored).
          Of course, that new issue appears on the summary views: upstream/downstream information on jobs is right whereas upstream/downstream information on builds is simply missing.

          Julien Carsique added a comment - Successfully tested on 1.491 with a cherry-pick of 4043905580df5bf22cde0eaf3dec103abdc88017 I tried with https://github.com/nuxeo/nuxeo-common/ and https://github.com/nuxeo/nuxeo-runtime/ with their "master" and "5.6.0" branches. I couldn't try much more with https://github.com/vietj/chromattic and https://github.com/vietj/wikbook because of build issues but it seems fine on the POM parsing part. Before the fix, nuxeo-common master (version 5.7-SNAPSHOT) was triggering nuxeo-runtime master (version 5.7-SNAPSHOT) and 5.6.0 (version 5.6.0-HF04-SNAPSHOT), whereas nuxeo-common 5.6.0 was triggering nothing at all. Note I didn't try to reproduce the issue with chromattic and wikbook before the fix. However, even if the triggering is fixed, I still have an issue (I don't know if it's exactly the same issue): relationship between builds is sticked at builds earlier the fix if there was no build before the fix, then the relationship is empty I'm talking about jenkins/projectRelationship?lhs=nuxeo-common-5.6.0&rhs=nuxeo-runtime-5.6.0 and jenkins/projectRelationship?lhs=nuxeo-common-master&rhs=nuxeo-runtime-master Before 1.480, the relationship is right. Since 1.481 until 1.491, without the current fix, the relationship seems still right even if triggering is wrong (see comment-168178 on JENKINS-15237 ). With the current fix applied on 1.491, the relationship is no more updated (new builds are ignored). Of course, that new issue appears on the summary views: upstream/downstream information on jobs is right whereas upstream/downstream information on builds is simply missing.

          Jesse Glick added a comment -

          Should this now be resolved as fixed?

          Jesse Glick added a comment - Should this now be resolved as fixed?

          Olivier Lamy added a comment -

          It looks yes.
          I didn't notice more complain

          Olivier Lamy added a comment - It looks yes. I didn't notice more complain

          Erik Riemers added a comment -

          Seems to have done it on our end. Had no complaints either.

          Erik Riemers added a comment - Seems to have done it on our end. Had no complaints either.

          Jay Meyer added a comment -

          Fixed in 1.492.

          I have not verified this myself, but I trust the word of others who have verified this.
          I have scheduled to try this on my builds the week of Dec-10. If it fails again, I will re-open this issue with the details of the failure.

          Jay Meyer added a comment - Fixed in 1.492. I have not verified this myself, but I trust the word of others who have verified this. I have scheduled to try this on my builds the week of Dec-10. If it fails again, I will re-open this issue with the details of the failure.

          Jay Meyer added a comment -

          I have verified this on my system today, it works.
          using version 1.494.

          Thanks for the fix, much appreciated.

          Jay Meyer added a comment - I have verified this on my system today, it works. using version 1.494. Thanks for the fix, much appreciated.

          Code changed in jenkins
          User: alexkoon
          Path:
          src/main/java/hudson/maven/ModuleDependency.java
          src/test/java/hudson/maven/MavenModuleTest.java
          http://jenkins-ci.org/commit/maven-plugin/1331c06d56902cff73afd66eb48cd50c06c481a2
          Log:
          JENKINS-15367 Fix for downstream dependencies when we have a specified version (not a version range).

          Originally-Committed-As: 4043905580df5bf22cde0eaf3dec103abdc88017

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: alexkoon Path: src/main/java/hudson/maven/ModuleDependency.java src/test/java/hudson/maven/MavenModuleTest.java http://jenkins-ci.org/commit/maven-plugin/1331c06d56902cff73afd66eb48cd50c06c481a2 Log: JENKINS-15367 Fix for downstream dependencies when we have a specified version (not a version range). Originally-Committed-As: 4043905580df5bf22cde0eaf3dec103abdc88017

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          src/main/java/hudson/maven/ModuleDependency.java
          src/test/java/hudson/maven/MavenModuleTest.java
          http://jenkins-ci.org/commit/maven-plugin/056f50426525563299f39f0688179f3c2aef2a66
          Log:
          Merge pull request #609 from alexkoon/master

          JENKINS-15367 Fix Maven downstream resolution when declared as a specific version.
          Originally-Committed-As: 2c469b37b563c5d6ca70ac7841897e1a20083130

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: src/main/java/hudson/maven/ModuleDependency.java src/test/java/hudson/maven/MavenModuleTest.java http://jenkins-ci.org/commit/maven-plugin/056f50426525563299f39f0688179f3c2aef2a66 Log: Merge pull request #609 from alexkoon/master JENKINS-15367 Fix Maven downstream resolution when declared as a specific version. Originally-Committed-As: 2c469b37b563c5d6ca70ac7841897e1a20083130

            olamy Olivier Lamy
            jaymeyer Jay Meyer
            Votes:
            35 Vote for this issue
            Watchers:
            42 Start watching this issue

              Created:
              Updated:
              Resolved: