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

Downstream projects should not be triggered anymore after upstream project pom version is changed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Jenkins 2.13
      Maven Plugin 2.13

      Hello,

      Here is a two projects dependency graph (fixed version dependency; no version range used):

      test:projectB:jar:1.0-SNAPSHOT
      \- test:projectA:jar:1.0-SNAPSHOT:compile
      

      I have two jobs:

      • jobA to build projectA (git: repoA, branch master),
      • jobB to build projectB (git: repoB, branch master).

      Both are using git/notifyCommit?url to build on git push.
      Both are also configured with Build whenever a SNAPSHOT dependency is built.

      Jenkins links automatically the two jobs, and jobB becomes a downstream job of job A.

      This works perfectly, until I update the version of projectA.

      When projectA is modified with a new version (for instance 1.1-SNAPSHOT), and commited/pushed, jobA is built.

      But the new version is not detected (the jenkins "internal" dependency graph is not updated) and so projectB is still built after, even if now projectB does not depends on projectA version 1.1-SNAPSHOT.

      Here is the log after the version change on projectA:

      Building in workspace /var/lib/jenkins/jobs/dependency-change/jobs/projectA/workspace
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url git@gitlab.local.net:thomas/project-a.git # timeout=10
      Fetching upstream changes from git@gitlab.local.net:thomas/project-a.git
       > git --version # timeout=10
      using GIT_SSH to set credentials 
       > git -c core.askpass=true fetch --tags --progress git@gitlab.local.net:thomas/project-a.git +refs/heads/*:refs/remotes/origin/*
       > git rev-parse fc4523c4031e230cb4515b68e869f12641c81a2f^{commit} # timeout=10
       > git branch -a -v --no-abbrev --contains fc4523c4031e230cb4515b68e869f12641c81a2f # timeout=10
      Checking out Revision fc4523c4031e230cb4515b68e869f12641c81a2f (origin/master)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f fc4523c4031e230cb4515b68e869f12641c81a2f
       > git rev-list d6b038828f79de23b8bcc4afe9f47563f9e92805 # timeout=10
      Parsing POMs
      Established TCP socket on 39356
      [workspace] $ java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.7.jar:/usr/share/maven/boot/plexus-classworlds.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven/ /var/cache/jenkins/war/WEB-INF/lib/remoting-2.60.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 39356
      <===[JENKINS REMOTING CAPACITY]===>channel started
      Executing Maven:  -B -f /var/lib/jenkins/jobs/dependency-change/jobs/projectA/workspace/pom.xml -V -e clean install
      Apache Maven 3.0.5 (Red Hat 3.0.5-16)
      Maven home: /usr/share/maven
      Java version: 1.8.0_91, vendor: Oracle Corporation
      Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-1.b14.el7_2.x86_64/jre
      Default locale: en_US, platform encoding: UTF-8
      OS name: "linux", version: "3.10.0-327.22.2.el7.x86_64", arch: "amd64", family: "unix"
      [INFO] Error stacktraces are turned on.
      [INFO] Scanning for projects...
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building projectA 1.1-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [...]
      

      Other pushes on projectA or manually triggered builds on jobA do not change anything.

      But, if I go to the Configure page of jobA and uncheck/check Build whenever a SNAPSHOT dependency is built and save, now when I manually trigger a build, the jobA will not trigger jobB at the end (as it should have since the version change).

      It seems modifying the job configuration triggers something...

      Thanks in advance.

            Unassigned Unassigned
            tsbx tsbx
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: