Changelog not reflecting properly

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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

            Assignee:
            Unassigned
            Reporter:
            Gourav Pattnaik
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: