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

Hardcoded branch name when resolving commit messages (Praqma case 13073)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      May 27, 2015 1:30:15 PM org.jenkinsci.plugins.pretestedintegration.PretestedIntegrationBuildWrapper setUp
      SEVERE: [PREINT] - setUp()-IntegationFailedExeception
      org.jenkinsci.plugins.pretestedintegration.exceptions.IntegationFailedExeception: Merge failure
      at org.jenkinsci.plugins.pretestedintegration.scm.git.AccumulatedCommitStrategy.integrate(AccumulatedCommitStrategy.java:99)
      at org.jenkinsci.plugins.pretestedintegration.AbstractSCMBridge.mergeChanges(AbstractSCMBridge.java:106)
      at org.jenkinsci.plugins.pretestedintegration.AbstractSCMBridge.prepareWorkspace(AbstractSCMBridge.java:91)
      at org.jenkinsci.plugins.pretestedintegration.PretestedIntegrationAction.initialise(PretestedIntegrationAction.java:75)
      at org.jenkinsci.plugins.pretestedintegration.PretestedIntegrationBuildWrapper.setUp(PretestedIntegrationBuildWrapper.java:76)
      at hudson.model.Build$BuildExecution.doRun(Build.java:156)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      at hudson.model.Run.execute(Run.java:1744)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:374)
      Caused by: java.lang.NullPointerException
      at org.eclipse.jgit.lib.ObjectIdOwnerMap.get(ObjectIdOwnerMap.java:131)
      at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:838)
      at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:753)
      at org.jenkinsci.plugins.pretestedintegration.scm.git.GetAllCommitsFromBranchCallback.invoke(GetAllCommitsFromBranchCallback.java:47)
      at org.jenkinsci.plugins.pretestedintegration.scm.git.GetAllCommitsFromBranchCallback.invoke(GetAllCommitsFromBranchCallback.java:23)
      at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
      at org.jenkinsci.plugins.gitclient.JGitAPIImpl.withRepository(JGitAPIImpl.java:128)
      at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:326)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:301)
      at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:260)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:325)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:69)
      at java.lang.Thread.run(Unknown Source)
      at ......remote call to jenkins-slave2-32-builder(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
      at hudson.remoting.Channel.call(Channel.java:753)
      at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:179)
      at com.sun.proxy.$Proxy64.withRepository(Unknown Source)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:238)
      at org.jenkinsci.plugins.pretestedintegration.scm.git.AccumulatedCommitStrategy.integrate(AccumulatedCommitStrategy.java:92)
      ... 10 more

      The integration branch is hardcoded to 'master' rather than the branch specified

        Attachments

          Activity

          Hide
          bue Bue Petersen added a comment -

          Need more information?

          Show
          bue Bue Petersen added a comment - Need more information?
          Hide
          bue Bue Petersen added a comment - - edited

          // limit the tree walk to keep away from master commits
          // Reference for this idea is: https://wiki.eclipse.org/JGit/User_Guide#Restrict_the_walked_revision_graph
          ObjectId to = repo.resolve("master");
          walk.markUninteresting(walk.parseCommit(to));

          Around line 44 in GetAllCommitsFromBranchCallback.java

          Show
          bue Bue Petersen added a comment - - edited // limit the tree walk to keep away from master commits // Reference for this idea is: https://wiki.eclipse.org/JGit/User_Guide#Restrict_the_walked_revision_graph ObjectId to = repo.resolve("master"); walk.markUninteresting(walk.parseCommit(to)); Around line 44 in GetAllCommitsFromBranchCallback.java
          Hide
          markewaite Mark Waite added a comment -

          Could you include the version numbers of the git plugin and the git client plugin that you're using? Since this plugin seems to be calling the git client plugin, there is some risk that the git client plugin is the source of the bug, rather than the plugin itself.

          Show
          markewaite Mark Waite added a comment - Could you include the version numbers of the git plugin and the git client plugin that you're using? Since this plugin seems to be calling the git client plugin, there is some risk that the git client plugin is the source of the bug, rather than the plugin itself.
          Hide
          bue Bue Petersen added a comment -

          Pretested Integration Plugin 2.2.3

          which uses

          <dependency>
          <groupId>org.jenkins-ci.plugins</groupId>
          <artifactId>git</artifactId>
          <version>2.2.0</version>
          </dependency>

          https://github.com/jenkinsci/pretested-integration-plugin/blob/pretested-integration-2.2.3/pom.xml

          I do think actually the problem is in our code... as ObjectId to = repo.resolve("master"); is using a hard-coded name master, instead of the branch the user chose as integration branch in our plugin.

          Show
          bue Bue Petersen added a comment - Pretested Integration Plugin 2.2.3 which uses <dependency> <groupId>org.jenkins-ci.plugins</groupId> <artifactId>git</artifactId> <version>2.2.0</version> </dependency> https://github.com/jenkinsci/pretested-integration-plugin/blob/pretested-integration-2.2.3/pom.xml I do think actually the problem is in our code... as ObjectId to = repo.resolve("master"); is using a hard-coded name master, instead of the branch the user chose as integration branch in our plugin.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Bue Petersen
          Path:
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GetAllCommitsFromBranchCallback.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/CustomIntegrationBranch.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/StaticGitRepositoryTestBase.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/TestUtilsFactory.java
          src/test/resources/customIntegrationBranch-repo_description.log
          src/test/resources/customIntegrationBranch.md
          src/test/resources/customIntegrationBranch.sh
          src/test/resources/customIntegrationBranch.zip
          http://jenkins-ci.org/commit/pretested-integration-plugin/ea943f30080a2f2db70625db83fe8882d742d021
          Log:
          JENKINS-28596 Fix for hardcoded branch name:

          When resolving accumulated commit messages, branch name was hardcoded to
          master.

          This change will allow custom named integration branch.

          Compare: https://github.com/jenkinsci/pretested-integration-plugin/compare/bba993008f51...ea943f30080a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bue Petersen Path: src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GetAllCommitsFromBranchCallback.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/CustomIntegrationBranch.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/StaticGitRepositoryTestBase.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/TestUtilsFactory.java src/test/resources/customIntegrationBranch-repo_description.log src/test/resources/customIntegrationBranch.md src/test/resources/customIntegrationBranch.sh src/test/resources/customIntegrationBranch.zip http://jenkins-ci.org/commit/pretested-integration-plugin/ea943f30080a2f2db70625db83fe8882d742d021 Log: JENKINS-28596 Fix for hardcoded branch name: When resolving accumulated commit messages, branch name was hardcoded to master. This change will allow custom named integration branch. Compare: https://github.com/jenkinsci/pretested-integration-plugin/compare/bba993008f51...ea943f30080a

            People

            • Assignee:
              bue Bue Petersen
              Reporter:
              madsnielsen Mads Nielsen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: