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

    XMLWordPrintable

    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

            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!
            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'
            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
            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 -

            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?
            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)

              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: