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

Git-Forensics: Reference build is always determined from the first repo checked out when multiple are available

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-forensics-plugin
    • None
    • git-forensics 0.8.1

      I noticed that the new reference build finder functionality in the git-forensics plugin breaks when multiple repo checkouts happen within the same job.

      The SCM data is seemingly gathered correctly, but when `discoverGitReferenceBuild` is executed it will always default to searching for a reference build based on the commit data of the first repo that was checked out. 

      In my teams workflow this is prohibitive from us using the functionality because all PRs first checkout a utility repo that contains groovy libraries and utility functions, then we checkout the main source code repo and run static analysis. Unfortunately this causes the reference build feature to only look at the commits from the utility repo instead of the commits from the main source code repo and always results in an incorrect build being picked.

      More specifically, we used a shared library structure via SCM where the repo containing the library is checked out prior to compilation of the main job script. See here: https://www.jenkins.io/doc/book/pipeline/shared-libraries/

      It would be ideal if the repo that was going to be analyzed could be specified as a parameter to `discoverGitReferenceBuild`, or at least picked via some other method.

            drulli Ulli Hafner
            alexfarra Alex Farra
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: