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

git-plugin does not discover tags

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.46.3
    • Similar Issues:

      Description

      We want to build tags automatically when they appear in the repository.

      We use GitHub, however github branch source plugin does not support such functionality yet (https://issues.jenkins-ci.org/browse/JENKINS-34395)

      The workaround is to use Multibranch Pipeline and poll the repository every X minutes.

      In the Multibranch Pipeline configuration set:

      Project Repository: <GIT_URL>

      Credentials: <credentials>

      Behaviours:

        Specify ref specs: +refs/tags/:refs/remotes/origin/tags/

       

      In this case no tags are built, the scan log contains following info:

      Started by timer
      [Tue Oct 17 16:03:00 UTC 2017] Starting branch indexing...
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to <GIT_URL>
       > git config remote.origin.url <GIT_URL> # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials 
       > git fetch --tags --progress origin +refs/tags/*:refs/remotes/origin/tags/*
      using GIT_ASKPASS to set credentials 
       > git ls-remote <GIT_URL> # timeout=10
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to <GIT_URL>
       > git config remote.origin.url <GIT_URL> # timeout=10
      Fetching & pruning origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials 
       > git fetch --tags --progress origin +refs/tags/*:refs/remotes/origin/tags/* --prune
      [Tue Oct 17 16:03:01 UTC 2017] Finished branch indexing. Indexing took 0.67 sec
      Finished: SUCCESS

       

      If we add another configuration parameter to the Multibranch Pipeline: discover branches, the scan log contains:

      Started by user Konstantin Ryakhovskiy
      [Tue Oct 17 16:19:37 UTC 2017] Starting branch indexing...
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to <GIT_URL>
       > git config remote.origin.url <GIT_URL> # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials 
       > git fetch --tags --progress origin +refs/tags/*:refs/remotes/origin/tags/*
      using GIT_ASKPASS to set credentials 
       > git ls-remote <GIT_URL> # timeout=10
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to <GIT_URL>
       > git config remote.origin.url <GIT_URL> # timeout=10
      Fetching & pruning origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials 
       > git fetch --tags --progress origin +refs/tags/*:refs/remotes/origin/tags/* --prune
      Listing remote references...
       > git config --get remote.origin.url # timeout=10
      using GIT_ASKPASS to set credentials 
       > git ls-remote -h <GIT_URL> # timeout=10
      Checking branches...
        ... //here are some branches at refs/heads/, but no tags
      [Tue Oct 17 16:19:38 UTC 2017] Finished branch indexing. Indexing took 0.61 sec
      Finished: SUCCESS

       

      There is no option "Discover Tags"

        Attachments

          Issue Links

            Activity

            Hide
            kr Konstantin Ryakhovskiy added a comment - - edited

            Stephen Connolly you mentioned "Discover Tags" option, but I do not have one.

            The git-plugin is of version 3.6.0.

            Maybe its not a bug?

            Show
            kr Konstantin Ryakhovskiy added a comment - - edited Stephen Connolly you mentioned "Discover Tags" option, but I do not have one. The git-plugin is of version 3.6.0. Maybe its not a bug?
            Hide
            stephenconnolly Stephen Connolly added a comment -

            If you are using the GitHub Branch Source then you are waiting for https://github.com/jenkinsci/github-branch-source-plugin/pull/158

            Show
            stephenconnolly Stephen Connolly added a comment - If you are using the GitHub Branch Source then you are waiting for https://github.com/jenkinsci/github-branch-source-plugin/pull/158

              People

              Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              kr Konstantin Ryakhovskiy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: