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

Unable to automatically discover and build git tags with Jenkins multibranch pipelines and the Git Plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      * Jenkins v2.141
      * Basic Branch Build Strategies Plugin v1.0.1
      * Git plugin v3.9.1
      * Bitbucket Server v5.13.1
      * Webhook to Jenkins for Bitbucket Server v4.4.4
      * Windows Server 2012 R2
    • Similar Issues:

      Description

      I configured a multibranch pipeline job to discover and build branches and tags for my git repository hosted in Bitbucket Server. New branches and commits are discovered and built correctly but new tags remain undiscovered. I can force tag discovery if I initiate a manual scan in Jenkins or I click "Trigger Jenkins" in the Webhook to Jenkins for Bitbucket Server UI for my repository.

       

      My Jenkins Configuration

      My Webhook to Jenkins for Bitbucket Server Configuration

       

      Originally, I wanted to use the Bitbucket Branch Source Plugin rather than the Git Plugin but in that case JENKINS-51063 prevents tag discovery and build. Is there a similar issue with the Git Plugin?

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment - - edited

            I believe this is already available if you install the Basic Branch Build Strategies Plugin as described in a jenkins.io blog post and in "Notes from the Lifeboat"

            Show
            markewaite Mark Waite added a comment - - edited I believe this is already available if you install the Basic Branch Build Strategies Plugin as described in a jenkins.io blog post and in " Notes from the Lifeboat "
            Hide
            iamrewt Ryan Taylor added a comment -

            I have the Basic Branch Build Strategies Plugin installed, and set it to discover tags, but it tags remain undiscovered. The mentioned post is using the Git*hub* Plugin, not the Git plugin. I have a support request out to Mohami (creators of the Webhook to Jenkins for Bitbucket Server) and they indicated it is an issue in the Git Plugin.

            I looked through git plugin source and unfortunately it has same issue [as JENKINS-51063]
            https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/GitSCMSource.java#L628
            it incorrectly creates instance GitBranchSCMHead for tags when fires SCMHeadEvent (this is event is used by MultiBranch pipelines to trigger jobs - Freestyle jobs have another invocation procedure). So I don't think it's possible to trigger new tags this way

            I'm not familiar enough with the plugin to make this assessment however.

            Show
            iamrewt Ryan Taylor added a comment - I have the Basic Branch Build Strategies Plugin installed, and set it to discover tags, but it tags remain undiscovered. The mentioned post is using the Git*hub* Plugin, not the Git plugin. I have a support request out to Mohami (creators of the Webhook to Jenkins for Bitbucket Server) and they indicated it is an issue in the Git Plugin. I looked through git plugin source and unfortunately it has same issue [as JENKINS-51063] https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/GitSCMSource.java#L628 it incorrectly creates instance GitBranchSCMHead for tags when fires SCMHeadEvent (this is event is used by MultiBranch pipelines to trigger jobs - Freestyle jobs have another invocation procedure) . So I don't think it's possible to trigger new tags this way I'm not familiar enough with the plugin to make this assessment however.
            Hide
            markewaite Mark Waite added a comment -

            Refer to JENKINS-47496 for more details on building tags with multibranch.

            Show
            markewaite Mark Waite added a comment - Refer to JENKINS-47496 for more details on building tags with multibranch.

              People

              • Assignee:
                Unassigned
                Reporter:
                iamrewt Ryan Taylor
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: