I'm using the 'Bitbucket Branch Source' plugin and see this on all builds, all branches and can't find any way to make it record changes. I fiddled with pretty much any git setting/extension I could find, it just keeps telling me "First time build. Skipping changelog."
It seems to have something to do with not being able to determine the revision of the previous build. What does work is overriding the checkout and getting changes against a specific branch:
{{
options
{
skipDefaultCheckout(true)
}
stages {
stage('Setup') {
steps {
checkout(changelog: true, scm:[
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
extensions: [[$class: 'ChangelogToBranch', options: [compareRemote: 'origin', compareTarget: 'master']],[$class: 'AuthorInChangelog'], [$class: 'CloneOption', noTags: false, reference: '', shallow: false], [$class: 'CleanBeforeCheckout']],
userRemoteConfigs: scm.userRemoteConfigs
])
}}
Based of https://devops.stackexchange.com/questions/4379/jenkins-shows-no-changes-in-any-of-the-builds
However that shows way to many changes.
Another observation is that on some projects I use a shared library, changes made to the library do show up. So something works...
Can you provide more details about conditions that might cause a build to be identified as a first-time build?
Were there specific changes that happened at the time in the git repository, in the job definition, or in the agent definitions?
Are you using ephemeral or static agents?
I inserted detection checks into several of my test jobs in hopes of seeing it, but did not see it. Will need more details in order to duplicate the problem.
Any other hints that might make the problem repeatable?