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

Use PrimaryInstanceMetadataAction for choosing default reference branch

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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".

        Attachments

          Issue Links

            Activity

            Hide
            kon Kalle Niemitalo added a comment - - edited

            if two or more branches have PrimaryInstanceMetadataAction, then Forensics API could still fall back to "master”.

            In principle, Forensics API could still try to disambiguate by excluding SCMHead instances that have PrimaryInstanceMetadataAction but are pull requests according to ChangeRequestSCMHead. However, there is no reason for such complexity if no plugin creates things like that.

            Show
            kon Kalle Niemitalo added a comment - - edited if two or more branches have PrimaryInstanceMetadataAction, then Forensics API could still fall back to "master”. In principle, Forensics API could still try to disambiguate by excluding SCMHead instances that have PrimaryInstanceMetadataAction but are pull requests according to ChangeRequestSCMHead. However, there is no reason for such complexity if no plugin creates things like that.

              People

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

                Dates

                Created:
                Updated:
                Resolved: