-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.60.1 LTS, all latest plugins on July 17 2017.
Jenkins server running Cent OS and Client running on a Windows Server 2012R2 VM.
In a Multibranch job, if the Jenkins File contains the following:
checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: "$\{env.BRANCH_NAME}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 0, noTags: true, reference: '', shallow: +*true*+]], submoduleCfg: [], userRemoteConfigs: [url: '[http://My]]
The "Recent Changes" of the branch will not update. Previous version (LTS 2.32.1) with old plugins did not had this problem.
Changing the checkout to:
checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: "$\{env.BRANCH_NAME}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 0, noTags: true, reference: '', shallow: +*false*+]], submoduleCfg: [], userRemoteConfigs: [url: '[http://My]]
allows to get the list of "Recent Changes" populated again, but at the cost of a considerably higher build time and stress on the GIT server as the repository need to be cloned from scratch every time (as we are running agents on VMs that are always started from the same snapshot).
Since a shallow clone may only clone the most recent change, it seems (at least to me) that the change list may be incorrect for a shallow clone that follows another shallow clone. If a shallow clone is followed by 2 or more commits to the repository, then another shallow clone is performed, the commits in the working repository may only be the original commit and the most recent commit in the repository.
You might try reducing load on your git server by using a narrow refspec instead of a shallow clone. A narrow refspec allows the git server to only return the history of a single branch, while a shallow clone allows the server to return the history of a limited number of commits for each branch that matches the refspec. The refspec setting is modified in the "Advanced" section of the repository definition.