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

Add an extension point so github et al can expose their default branches via scm api

    Details

    • Epic Link:
    • Similar Issues:

      Description

      Github and bitbucket (and likely others) have the concept of a default branch.

      This nominally is "master" by convention with git, but it is common enough for people to make up their own convention. With github you can tell github what the master branch is, and this changes the behavior of the UI somewhat. This is also exposed via the api.

      Given the importance of main/master/default branches in UI, it would be nice to be able to expose this via the respective plugins. The common dependency I believe is scm-api (even though the git implementation won't implement this extension, one of the github ones can, as it depends on git, which depends on scm-api)

        Attachments

          Issue Links

            Activity

            michaelneale Michael Neale created issue -
            michaelneale Michael Neale made changes -
            Field Original Value New Value
            Epic Link JENKINS-35759 [ 171771 ]
            michaelneale Michael Neale made changes -
            Assignee Vivek Pandey [ vivek ]
            Hide
            michaelneale Michael Neale added a comment - - edited

            Vivek Pandey https://github.com/jenkinsci/scm-api-plugin/pull/15 - not sure if that is the best approach or best place, but is a stab in the dark..

            obviously to make it useful, one of the github plugins will need to implement this extension point (up to you how this is called, may affect where we put extension point)

            Show
            michaelneale Michael Neale added a comment - - edited Vivek Pandey https://github.com/jenkinsci/scm-api-plugin/pull/15 - not sure if that is the best approach or best place, but is a stab in the dark.. obviously to make it useful, one of the github plugins will need to implement this extension point (up to you how this is called, may affect where we put extension point)
            jglick Jesse Glick made changes -
            Labels api
            jamesdumay James Dumay made changes -
            Sprint tasman [ 136 ]
            jamesdumay James Dumay made changes -
            Rank Ranked lower
            jamesdumay James Dumay made changes -
            Assignee Vivek Pandey [ vivek ]
            jamesdumay James Dumay made changes -
            Sprint tasman [ 136 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            Hide
            jamesdumay James Dumay added a comment -

            Stephen Connolly would it be possible to get this as a property on a Multibranch Pipeline action?

            Show
            jamesdumay James Dumay added a comment - Stephen Connolly would it be possible to get this as a property on a Multibranch Pipeline action?
            stephenconnolly Stephen Connolly made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            stephenconnolly Stephen Connolly made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            stephenconnolly Stephen Connolly made changes -
            Assignee Stephen Connolly [ stephenconnolly ]
            stephenconnolly Stephen Connolly made changes -
            Component/s blueocean-plugin [ 21481 ]
            stephenconnolly Stephen Connolly made changes -
            Issue Type Task [ 3 ] New Feature [ 2 ]
            Hide
            stephenconnolly Stephen Connolly added a comment -
            Show
            stephenconnolly Stephen Connolly added a comment - https://github.com/jenkinsci/scm-api-plugin/pull/20 is the api implementation
            Hide
            jamesdumay James Dumay added a comment -

            This is really awesome! Thanks Stephen

            Show
            jamesdumay James Dumay added a comment - This is really awesome! Thanks Stephen
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/scm/api/metadata/PrimaryInstanceMetadataAction.java
            http://jenkins-ci.org/commit/scm-api-plugin/a969bee9193e0ddede577a819de4f9732328c7b6
            Log:
            [FIXED JENKINS-38718] Add a metadata action to identify 'primary instances'

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/scm/api/metadata/PrimaryInstanceMetadataAction.java http://jenkins-ci.org/commit/scm-api-plugin/a969bee9193e0ddede577a819de4f9732328c7b6 Log: [FIXED JENKINS-38718] Add a metadata action to identify 'primary instances'
            stephenconnolly Stephen Connolly made changes -
            Component/s blueocean-plugin [ 21481 ]
            Component/s scm-api-plugin [ 18054 ]
            jamesdumay James Dumay made changes -
            Link This issue is duplicated by JENKINS-38601 [ JENKINS-38601 ]
            Hide
            jamesdumay James Dumay added a comment -

            Stephen Connolly I now use PrimaryInstanceMetadataAction to determine "defaultness of the branch" in https://github.com/jenkinsci/blueocean-plugin/pull/707

            Works like a charm!

            Show
            jamesdumay James Dumay added a comment - Stephen Connolly I now use PrimaryInstanceMetadataAction to determine "defaultness of the branch" in https://github.com/jenkinsci/blueocean-plugin/pull/707 Works like a charm!
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-40836 [ JENKINS-40836 ]
            jamesdumay James Dumay made changes -
            Assignee Stephen Connolly [ stephenconnolly ] James Dumay [ jamesdumay ]
            jamesdumay James Dumay made changes -
            Sprint pannonian [ 211 ]
            jamesdumay James Dumay made changes -
            Rank Ranked lower
            jamesdumay James Dumay made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jamesdumay James Dumay made changes -
            Sprint pannonian [ 211 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-1791 (Web Link)" [ 18568 ]

              People

              • Assignee:
                jamesdumay James Dumay
                Reporter:
                michaelneale Michael Neale
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: