jenkinsci / jenkinsci/git-plugin

[JENKINS-66054] Changelog not reflecting properly

Open
#3,668 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

The changelog is not reflecting properly.

In my second stage I'm doing checkout and I'm using the ChangelogToBranch extension to record the change. But its not reflecting on the change tab.

I have total 4 repositories, and I'm checking out all the four repositories to record any changes.

 

In the below code I'm passing withChangelog = true

 

void checkoutBranch(List<String> branchNames, String repository, String targetDir = '', Boolean withChangelog = false) {
    def checkoutInfo = resolveScm(
source: [$class       : 'GitSCMSource',
 credentialsId: 'github-jenkins', id: '_',
 remote       : "xyz.git",
 traits       : [[$class: 'CleanAfterCheckoutTrait'],
 [$class: 'CleanBeforeCheckoutTrait'],
 [$class: 'GitLFSPullTrait'],
 [$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait'],
 headWildcardFilter(includes: branchNames.join(' '))]],
targets: branchNames
    )

    checkoutRevision(checkoutInfo.getBranches().get(0).getName(), repository, targetDir, withChangelog)
}

def checkoutRevision(String revision, String repository, String targetDir = '', Boolean withChangelog = false) {
    def extensions = [[$class: 'CleanCheckout'],
      [$class: 'CleanBeforeCheckout'],
      [$class: 'CloneOption', reference: referenceRepository(repository), honorRefspec: true, noTags: true],
      [$class: 'GitLFSPull']]

    if (withChangelog) {
extensions << [$class: 'ChangelogToBranch', options: [compareRemote: 'origin', compareTarget: env.BRANCH_NAME]]
    }

    dir(targetDir) {
def checkoutResult = checkout changelog: true, poll: false,
    scm: [$class   : 'GitSCM',
  branches : [[name: revision]],
  browser  : [$class: 'GithubWeb', repoUrl: "http://github.com/xyz/${repository}"],
  doGenerateSubmoduleConfigurations: false,
  extensions       : extensions,
  submoduleCfg     : [],
  userRemoteConfigs: [[credentialsId: 'github-jenkins', url: "xyz.git"]]]
sshagent(['github-jenkins']) {
    command 'git -c lfs.concurrenttransfers=50 lfs pull', label: 'Ensure git lfs objects are present'
}
return checkoutResult
    }
}

 

Attaching the screenshots for reference

 

Jenkins Version : 2.263.1

Git Plugin Version: 4.6.0


Originally reported by whitewolf123, imported from: Changelog not reflecting properly
  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-02
Raw content of original issue

The changelog is not reflecting properly.

In my second stage I'm doing checkout and I'm using the ChangelogToBranch extension to record the change. But its not reflecting on the change tab.

I have total 4 repositories, and I'm checking out all the four repositories to record any changes.

 

In the below code I'm passing withChangelog = true

 

void checkoutBranch(List<String> branchNames, String repository, String targetDir = '', Boolean withChangelog = false) {
    def checkoutInfo = resolveScm(
        source: [$class       : 'GitSCMSource',
                 credentialsId: 'github-jenkins', id: '_',
                 remote       : "xyz.git",
                 traits       : [[$class: 'CleanAfterCheckoutTrait'],
                                 [$class: 'CleanBeforeCheckoutTrait'],
                                 [$class: 'GitLFSPullTrait'],
                                 [$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait'],
                                 headWildcardFilter(includes: branchNames.join(' '))]],
        targets: branchNames
    )

    checkoutRevision(checkoutInfo.getBranches().get(0).getName(), repository, targetDir, withChangelog)
}

def checkoutRevision(String revision, String repository, String targetDir = '', Boolean withChangelog = false) {
    def extensions = [[$class: 'CleanCheckout'],
                      [$class: 'CleanBeforeCheckout'],
                      [$class: 'CloneOption', reference: referenceRepository(repository), honorRefspec: true, noTags: true],
                      [$class: 'GitLFSPull']]

    if (withChangelog) {
        extensions << [$class: 'ChangelogToBranch', options: [compareRemote: 'origin', compareTarget: env.BRANCH_NAME]]
    }

    dir(targetDir) {
        def checkoutResult = checkout changelog: true, poll: false,
            scm: [$class                           : 'GitSCM',
                  branches                         : [[name: revision]],
                  browser                          : [$class: 'GithubWeb', repoUrl: "http://github.com/xyz/${repository}"],
                  doGenerateSubmoduleConfigurations: false,
                  extensions                       : extensions,
                  submoduleCfg                     : [],
                  userRemoteConfigs                : [[credentialsId: 'github-jenkins', url: "xyz.git"]]]
        sshagent(['github-jenkins']) {
            command 'git -c lfs.concurrenttransfers=50 lfs pull', label: 'Ensure git lfs objects are present'
        }
        return checkoutResult
    }
}

 

Attaching the screenshots for reference

 

Jenkins Version : 2.263.1

Git Plugin Version: 4.6.0

2 attachments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names the ChangelogToBranch extension and the checkout call using changelog: true, but no repository file or test. Start by reproducing the checkout across four repositories with compareRemote set to origin and compareTarget set to env.BRANCH_NAME; done means the expected commits appear in Jenkins's Changes tab.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.