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

discoverGitReferenceBuild always reports "no reference build found"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-forensics-plugin
    • None
    • Jenkins 2.479.1; Git Forensics Plugin 2.2.1

      I've added discoverGitReferenceBuild to a multibranch pipeline pulling from a git repository 'demo' in Bitbucket Server. My branch is 'enable-reference-build', so it's using itself as a reference.

      pipeline {
        agent any;
        stages {
          stage('Reference') {
            steps {
              discoverGitReferenceBuild referenceJob: 'demo/enable-reference-build'
            }
          }
        }
      }
      

      When I build this pipeline, it reports

      Configured reference job: 'demo/enable-reference-build'
      -> selected build '#5' of reference job does not yet contain a `GitCommitsRecord`
      -> no reference build found
      No reference build with required status found that contains matching commits
      

      The branch has 6 commits, well under maxCommits, so I don't think this is related to JENKINS-66479. I get the same message with referenceJob: main. Enabling latestBuildIfNotFound allows it to fallback to the latest build, but subsequent builds continue to report the warning:

      Configured reference job: 'demo/enable-reference-build'
      -> selected build '#7' of reference job does not yet contain a `GitCommitsRecord`
      -> no reference build found
      No reference build with required status found that contains matching commits
      Falling back to latest completed build of reference job: '#7'
      

          [JENKINS-74921] discoverGitReferenceBuild always reports "no reference build found"

          Patrick Conley created issue -

            drulli Ulli Hafner
            pconley Patrick Conley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: