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

Prune stale branches prevents git plugin change history display

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      git plugin 2.3.6 pre-release (pre-release for git 2.4.0)
      git client plugin 1.18.0 pre-release
    • Similar Issues:

      Description

      A git SCM based job will stop showing changes (both "Recent Changes" and "Changes") if "Prune stale remote-tracking branches" is enabled. It will resume showing changes if the "Prune stake remote-tracking branches is removed from the job definition.

      It appears that a new method "purgeStaleBranches" was added to the git plugin in March 2015 . It is purging a branch named "refs/remotes/origin/master" even though that is the only branch defined in the job.

      To duplicate the problem:

      1. Start Jenkins
      2. Install pre-release git client plugin
      3. Install pre-release git plugin
      4. Configure a new job with Git SCM as source control
      5. Configure the job to poll SCM frequently (once a minute)
      6. Run the job once, confirm no history is shown
      7. Commit a change to the repository that job is tracking
      8. Wait for polling to detect the change, confirm history is shown
      9. Reconfigure job to add "Prune stale remote-tracking branches"
      10. Commit a change to the repository that job is tracking
      11. Wait for polling to detect the change, confirm history is shown
      12. Commit another change to the repository that job is tracking
      13. Wait for polling to detect the change, confirm history is NOT shown

      Once history is not being shown, it will continue to not be shown, even though the polling log and the build status page shows that the job was started by an SCM change.

      If the "Prune stale remote-tracking branches" setting is removed, then two builds later the job will begin showing history again.

        Attachments

        1. Selection_042.png
          Selection_042.png
          45 kB
        2. Selection_043.png
          Selection_043.png
          86 kB
        3. Selection_044.png
          Selection_044.png
          48 kB
        4. Selection_045.png
          Selection_045.png
          15 kB
        5. Selection_046.png
          Selection_046.png
          22 kB

          Issue Links

            Activity

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                markewaite Mark Waite
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: