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

Use PrimaryInstanceMetadataAction for choosing default reference branch

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • forensics-api-plugin
    • None

      Forensics API currently hardcodes DEFAULT_BRANCH = "master" as the reference branch if not set with the referenceJob: or defaultBranch: parameter of the discoverReferenceBuild or discoverGitReferenceBuild pipeline step. However, the primary branches in many repositories have been renamed to "main".

      Forensics API could search for PrimaryInstanceMetadataAction (source, javadoc) in the SCMHead instances. That would let it find the renamed primary branch without needing extra configuration. If no branch has PrimaryInstanceMetadataAction (because the SCM does not support that, or because the primary branch was excluded from the multibranch project), or if two or more branches have PrimaryInstanceMetadataAction, then Forensics API could still fall back to "master".

            drulli Ulli Hafner
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: