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

incremental builds leave modules unbuilt upon failure

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None

      We're using maven + hudson + java. I kicked off a build which resulted in a failure in a module. This left several modules unbuilt, even though they did not depend on the failed module. I kicked off a new build, however, the previously unbuilt modules were still not rebuilt. Please let me know if you need more information.

          [JENKINS-5764] incremental builds leave modules unbuilt upon failure

          dogfood added a comment -

          Integrated in jenkins_main_trunk #622
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt

          Christoph Kutzinski : f4233876cdab86c7d19ecf3fcd8f0c530d39117f
          Files :

          • maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java
          • maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          dogfood added a comment - Integrated in jenkins_main_trunk #622 [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt Christoph Kutzinski : f4233876cdab86c7d19ecf3fcd8f0c530d39117f Files : maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          banoss added a comment -

          Thanks for this one kutzi!

          I've run some tests which is now working fine for the scenario above and it does remember beyond 1 build

          This problem still exists if there is a POM parsing problem - I suspect this is because the build has not properly kicked off by this time. This scenario still requires a full build to be forced. I'll play some more.

          banoss added a comment - Thanks for this one kutzi! I've run some tests which is now working fine for the scenario above and it does remember beyond 1 build This problem still exists if there is a POM parsing problem - I suspect this is because the build has not properly kicked off by this time. This scenario still requires a full build to be forced. I'll play some more.

          kutzi added a comment -

          You're welcome.

          Could you do me a favour and create a new issue for the POM parsing problem?

          kutzi added a comment - You're welcome. Could you do me a favour and create a new issue for the POM parsing problem?

          Shouldn't the next build include not only modules that weren't built, but ALL modules of the failed build? Else Jenkins' PostBuild deploy action would not work (see JENKINS-5121):

          Given A -> B -> C

          A has changes, A, B and C are built, failure during build of B
          changes in B (to correct the previous problem) : B and C are built and deployed. Or worse, B fails because its changes depend on previous changes from A
          Changes from A a never deployed, resulting in an inconsistent repository.

          If the second build would include ALL modules of failed build 1, the problem would disappear.

          This solution would be way faster to implement than trying to preserve artifacts from previous builds.

          Stephan Pauxberger added a comment - Shouldn't the next build include not only modules that weren't built, but ALL modules of the failed build? Else Jenkins' PostBuild deploy action would not work (see JENKINS-5121 ): Given A -> B -> C A has changes, A, B and C are built, failure during build of B changes in B (to correct the previous problem) : B and C are built and deployed. Or worse, B fails because its changes depend on previous changes from A Changes from A a never deployed, resulting in an inconsistent repository. If the second build would include ALL modules of failed build 1, the problem would disappear. This solution would be way faster to implement than trying to preserve artifacts from previous builds.

          banoss added a comment -

          I agree, don't want to start flaffing about with artefacts...

          Well, the worst case is this grows to a full build, which is a small price to pay for a consistent set of artefacts which is the goal and reason for using the post-build deploy task. I'd be happy with this.

          If your choosing not to use the post-build task and rely on "clean deploy" then you are OK with the current fix (deploy as you go) as you want fast incrementals and fast fixes I would guess. You are taking artefacts at risk. Again I'd be happy with this trade off.

          There is a question here whether to change the behaviour based on the job option?

          banoss added a comment - I agree, don't want to start flaffing about with artefacts... Well, the worst case is this grows to a full build, which is a small price to pay for a consistent set of artefacts which is the goal and reason for using the post-build deploy task. I'd be happy with this. If your choosing not to use the post-build task and rely on "clean deploy" then you are OK with the current fix (deploy as you go) as you want fast incrementals and fast fixes I would guess. You are taking artefacts at risk. Again I'd be happy with this trade off. There is a question here whether to change the behaviour based on the job option?

          kutzi added a comment - - edited

          Actually, I wanted to disagree first, but then I thought that you're right. Deploy action might be handled as a special case, but there are possibly many more after-build actions which we don't know about. So just building all the same modules again - plus any with new SCM changes - might be the safest way to handle that.

          But unfortunately it's not easier to implemented that - not least because I've already implemented the other way.

          kutzi added a comment - - edited Actually, I wanted to disagree first, but then I thought that you're right. Deploy action might be handled as a special case, but there are possibly many more after-build actions which we don't know about. So just building all the same modules again - plus any with new SCM changes - might be the safest way to handle that. But unfortunately it's not easier to implemented that - not least because I've already implemented the other way.

          kutzi added a comment - - edited

          Closing this again as 'this' bug as per original description is fixed.
          The issue with the deployment of artifacts is JENKINS-5121

          kutzi added a comment - - edited Closing this again as 'this' bug as per original description is fixed. The issue with the deployment of artifacts is JENKINS-5121

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java
          http://jenkins-ci.org/commit/jenkins/f4233876cdab86c7d19ecf3fcd8f0c530d39117f
          Log:
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt
          upon failure

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java http://jenkins-ci.org/commit/jenkins/f4233876cdab86c7d19ecf3fcd8f0c530d39117f Log: [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt upon failure

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/27871ce1df3cebdcffd3e2992c21c92a8696df75
          Log:
          record changes for JENKINS-5764 and JENKINS-9072

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/27871ce1df3cebdcffd3e2992c21c92a8696df75 Log: record changes for JENKINS-5764 and JENKINS-9072

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          src/main/java/hudson/maven/UnbuiltModuleAction.java
          http://jenkins-ci.org/commit/maven-plugin/3faaa85e4804cdb7e5462960b036f1fd9276d018
          Log:
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt
          upon failure
          Originally-Committed-As: f4233876cdab86c7d19ecf3fcd8f0c530d39117f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/maven/MavenBuild.java src/main/java/hudson/maven/MavenModuleSetBuild.java src/main/java/hudson/maven/UnbuiltModuleAction.java http://jenkins-ci.org/commit/maven-plugin/3faaa85e4804cdb7e5462960b036f1fd9276d018 Log: [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt upon failure Originally-Committed-As: f4233876cdab86c7d19ecf3fcd8f0c530d39117f

            kutzi kutzi
            matthewnewhook matthewnewhook
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: