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

Changelog not reflecting properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      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

            Unassigned Unassigned
            whitewolf123 Gourav Pattnaik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: