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

Group changelog entries by Jenkins build numbers

    XMLWordPrintable

Details

    Description

      It would be nice if the changelog could optionally be grouped by jenkins job build numbers. Not everyone tags every build. So one could use the build number as some kind of "implicit tag" to group those commits that were added for a build.

      Attachments

        Activity

          capf Carsten Pfeiffer created issue -
          lubo_varga_nike Lubo Varga added a comment -

          What about to set "from commit" to last successful build (it is $GIT_PREVIOUS_SUCCESSFUL_COMMIT, see environment variables here: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeaturesorigin%2Fmaster) and till just current commit (it is $GIT_COMMIT variable). It would always give you git changelog from last successful build till current build.

          lubo_varga_nike Lubo Varga added a comment - What about to set "from commit" to last successful build (it is $GIT_PREVIOUS_SUCCESSFUL_COMMIT, see environment variables here: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeaturesorigin%2Fmaster ) and till just current commit (it is $GIT_COMMIT variable). It would always give you git changelog from last successful build till current build.
          postman Per Östman added a comment -

          That would be good. Since the git environment variables are not exposed to a pipeline job, I've been forced to do a workaround to accomplish getting the changelog since last successful build.

          postman Per Östman added a comment - That would be good. Since the git environment variables are not exposed to a pipeline job, I've been forced to do a workaround to accomplish getting the changelog since last successful build.
          tomasbjerre Tomas Bjerre made changes -
          Field Original Value New Value
          Assignee Paul Wellner Bou [ paulwellnerbou ] Tomas Bjerre [ tomasbjerre ]
          tomasbjerre Tomas Bjerre added a comment -

          Here is an example that recursively gets the older builds:

          https://stackoverflow.com/questions/38084806/how-to-get-the-changes-since-the-last-successful-build-in-jenkins-pipeline

          Here is an example that gets the changesets of builds:

          https://support.cloudbees.com/hc/en-us/articles/217630098-How-to-access-Changelogs-in-a-Pipeline-Job-

          Using that in combination with this plugin should solve this.

           def changelogString = gitChangelog returnType: 'STRING',
            from: [type: 'COMMIT', value: 'commit hash here'],
            to: [type: 'COMMIT', value: 'next build commit hash here'],
            template: """
             the template...  
            """
           
           println changelogString
          

           
           

          tomasbjerre Tomas Bjerre added a comment - Here is an example that recursively gets the older builds: https://stackoverflow.com/questions/38084806/how-to-get-the-changes-since-the-last-successful-build-in-jenkins-pipeline Here is an example that gets the changesets of builds: https://support.cloudbees.com/hc/en-us/articles/217630098-How-to-access-Changelogs-in-a-Pipeline-Job- Using that in combination with this plugin should solve this.  def changelogString = gitChangelog returnType:  'STRING' ,   from: [type:  'COMMIT' , value:  'commit hash here' ],   to: [type:  'COMMIT' , value:  'next build commit hash here' ],   template: """    the template...     """    println changelogString    
          tomasbjerre Tomas Bjerre made changes -
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            tomasbjerre Tomas Bjerre
            capf Carsten Pfeiffer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: