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

GitCheckoutListener Gets Last Commit of Unrelated Repos

XMLWordPrintable

      When running a build for a project, checking out another repository first causes GitForensics to conflate the latest commit of this unrelated repository with the repository being built. This occurs near the beginning of a build, before discoverGitReferenceBuild is called. Here's an example log of the build, where <current-repo> is the repo being built and <other-repo> is the unrelated repo that was checked out first:

      [GitCheckoutListener] Recording commits of 'git https://<other-repo>'
      [GitCheckoutListener] Found previous build 'Folder/<current-repo>/develop #14' that contains recorded Git commits
      [GitCheckoutListener] -> Starting recording of new commits since '<other-repo-hash-1>'
      [GitCheckoutListener] -> Multiple parent commits found - storing latest commit of local merge '<other-repo-hash-2>'
      [GitCheckoutListener] -> Using parent commit '<other-repo-hash-3>' of local merge as starting point
      [GitCheckoutListener] -> Storing target branch head '<other-repo-hash-4>' (second parent of local merge) 
      [GitCheckoutListener] -> Recorded 200 new commits
      [GitCheckoutListener] -> The latest commit '<other-repo-hash-2>' is a merge commit

      When using this to calculate code coverage deltas with the Coverage Plugin for Jenkins, the following output is observed:

      [Coverage] [-ERROR-] Errors while reporting code coverage results:
      [Coverage] [-ERROR-] Computing delta information failed with an exception:
      [Coverage] [-ERROR-] org.eclipse.jgit.errors.MissingObjectException: Missing unknown <other-repo-hash-1> 

      Reports are then generated with undefined coverage deltas.

            drulli Ulli Hafner
            agar3927 Andrew
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: