-
Bug
-
Resolution: Unresolved
-
Major
-
None
We have problem by incremental build jenkins 1.506 and gerrit-trigger 2.8.0. if we push for example 3 commit at once, only the last commit will be built.
The problem ist in com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser.prevBuildForChangelog(). This methods return parent commit as last commit, which let git-plugin build a wrong changelog.xml. and jenkins use this changelog.xml for incremental build.
Patch for this problem:
GerritTriggerBuildChooser.java
--- a/gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java +++ b/gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java @@ -112,6 +112,14 @@ // Now we cheat and add the parent as the last build on the branch, so we can // get the changelog working properly-ish. ObjectId parentSha1 = getFirstParent(sha1, git); + + if(data != null) { + Build b = data.getLastBuildOfBranch(singleBranch); + if(b != null) { + parentSha1 = b.getSHA1(); + } + } + Revision parentRev = new Revision(parentSha1); parentRev.getBranches().add(new Branch(singleBranch, parentSha1));
- is related to
-
JENKINS-16470 gerrit trigger does not deal with ref-updated very well
-
- Open
-