GithubHelp home page GithubHelp logo

jenkinsci / git-changelog-plugin Goto Github PK

View Code? Open in Web Editor NEW
57.0 106.0 38.0 1.13 MB

Creates a changelog, or release notes, based on Git commits between 2 revisions.

Home Page: https://plugins.jenkins.io/git-changelog

License: MIT License

Shell 0.60% Java 97.42% HTML 0.17% Mustache 1.81%
changelog changelog-generator release-notes release-automation

git-changelog-plugin's Introduction

Git Changelog Plugin

Build Status

Creates a changelog, or release notes, based on Git commits between 2 revisions.

This can also be done with a command line tool.

Usage

You can use this plugin either in a pipeline or as a post-build action.

There is a complete running example available here: https://github.com/tomasbjerre/jenkins-configuration-as-code-sandbox

Pipeline

The plugin is compatible with the pipeline plugin and can be configured to support many use cases. You probably want to adjust it using the Snippet Generator.

The gitChangelog step can return:

  • Context - An object that contains all the information needed to create a changelog. Can be used to gather information from Git like committers, emails, issues and much more.
  • String - A string that is a rendered changelog, ready to be published. Can be used to publish on build summary page, on a wiki, emailed and much more.

The template and context is documented here.

It can integrate with issue management systems to get titles of issues and links. You will probably want to avoid specifying credentials in plain text in your script. One way of doing that is using the credentials binding plugin. The supported integrations are:

  • GitLab
  • GitHub
  • Jira

You can create a file or maybe publish the changelog with:

You can filter out a subset of the commits by:

  • Specifying specific from/to references/commits.
  • Adding filter based on message.
  • Adding filter based on commit time.
  • Filter tags based on tag name.
  • Filter commits based on commit time.
  • Ignore commits that does not contain an issue.

You can make the changelog prettier by:

  • Transforming tag name to something more readable.
  • Changing date display format.
  • Creating virtual tag, that contains all commits that does not belong to any other tag. This can be named something like Unreleased.
  • Creating virtual issue, that contains all commits that does not belong to any other issue.
  • Remove issue from commit message. This can be named something like Wall of shame and list all committers that did not commit on an issue.

Check the Snippet Generator to see all features!

Pipeline with context

Here is an example that clones a repo, gathers all jiras and adds a link to jira in the description of the job. The context contains much more then this and is documented here.

node {
 deleteDir()
 sh """
 git clone [email protected]:jenkinsci/git-changelog-plugin.git .
 """

 def changelogContext = gitChangelog returnType: 'CONTEXT',
  from: [type: 'REF', value: 'git-changelog-1.50'],
  to: [type: 'REF', value: 'master'],
  jira: [issuePattern: 'JENKINS-([0-9]+)\\b', password: '', server: '', username: '']

 Set<String> issueIdentifiers = new TreeSet<>()
 changelogContext.issues.each { issue ->
  if (issue.name == 'Jira') {
   issueIdentifiers.add(issue.issue)
  }
 }
 currentBuild.description = "http://jira.com/issues/?jql=key%20in%20%28${issueIdentifiers.join(',')}%29"
}

Pipeline with string

Here is an example that clones a repo and publishes the changelog on job page. The template and context is documented here.

node {
 deleteDir()
 sh """
 git clone [email protected]:jenkinsci/git-changelog-plugin.git .
 """

 def changelogString = gitChangelog returnType: 'STRING',
  from: [type: 'REF', value: 'git-changelog-1.50'],
  to: [type: 'REF', value: 'master'],
  template: """
  // Template is documented below!
  """

 currentBuild.description = changelogString
}

Determine next version from commit messages

By giving the plugin patterns, to match against commits, it can calculate next semantic version to use. This can be part of a release-pipeline, to automate version stepping. It will find the previous highest semantic Git tag and step it depending of matched patterns.

def nextVersion = getNextSemanticVersion()
println "Next version:" + nextVersion.toString();
println " Major:" + nextVersion.getMajor();
println " Minor:" + nextVersion.getMinor();
println " Patch:" + nextVersion.getPatch();

You can also specify custom regexp to match against commits:

def nextVersion = getNextSemanticVersion majorPattern: '^[Bb]reaking.*',
    minorPattern: '^[Ff]eature.*',
    patchPattern: '^[Ff]ix.*'

Determine highest version from commit messages

The plugin can find the previous highest semantic Git tag and provide major/minor/path numbers as well as the tag.

def highestVersion = getHighestSemanticVersion()
println "Highest version:" + highestVersion.toString();
println " Major:" + highestVersion.getMajor();
println " Minor:" + highestVersion.getMinor();
println " Patch:" + highestVersion.getPatch();
println " Git tag:" + highestVersion.findTag().orElse("");

Templates

The template and context is documented here.

Template - Simple

{{#tags}}
## {{name}}
 {{#issues}}
  {{#hasIssue}}
   {{#hasLink}}
### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
   {{/hasLink}}
   {{^hasLink}}
### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
   {{/hasLink}}
  {{/hasIssue}}
  {{^hasIssue}}
### {{name}}
  {{/hasIssue}}

  {{#commits}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
 * {{.}}
{{/messageBodyItems}}

[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

  {{/commits}}

 {{/issues}}
{{/tags}}

Template - Semantic versioning from conventional commits

If you are using conventional commits:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

A changelog can be rendered (using Helpers) like this:

# Changelog

{{#tags}}
{{#ifReleaseTag .}}
## [{{name}}](https://gitservice/{{name}}) ({{tagDate .}})

  {{#ifContainsType commits type='feat'}}
### Features

    {{#commits}}
      {{#ifCommitType . type='feat'}}
 - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://gitservice/commit/{{hashFull}}))
      {{/ifCommitType}}
    {{/commits}}
  {{/ifContainsType}}

  {{#ifContainsType commits type='fix'}}
### Bug Fixes

    {{#commits}}
      {{#ifCommitType . type='fix'}}
 - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://gitservice/commit/{{hashFull}}))
      {{/ifCommitType}}
    {{/commits}}
  {{/ifContainsType}}

{{/ifReleaseTag}}
{{/tags}}

Post-build action

When the plugin is installed, it will add a new post build action in Jenkins job configuration.

Git Changelog

A couple of revisions are configured along with some other optional features. A editable template is available for the user to tweak.

Select references

The changelog is created from parsing Git and rendering the template with a context derived from the configured revisions.

Tweak template

Development

This plugin can be built and started with maven and Jenkins' hpi plugin:

./run.sh

The functionality is implemented in git-changelog-lib. Pull requests are welcome!

git-changelog-plugin's People

Contributors

darxriggs avatar maartendcrius avatar markewaite avatar nemui avatar nwton avatar paulwellnerbou avatar tomasbjerre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-changelog-plugin's Issues

Commits returned from pipeline step are different from git log and freestyle post build action

  • Plugin version used = Version: 3.0
  • Jenkins version used = 2.260
  • Your configuration:
    • Template and any other relevant details =
      Running as a pipeline step, we call a function that performs the gitChangelog step.
def get_changelog_string(gitUrl,from,to,template = changeLogTemplate, throwException = true){
    try{
        git gitUrl
        sh "git log --pretty=oneline '$from'...'$to'"

        def changeLogString = gitChangelog returnType: 'STRING',
                from: [type: 'REF', value: from],
                to: [type: 'REF', value: to],
                template: changeLogTemplate,
                ignoreCommitsWithoutIssue : false,
                jira: [issuePattern: '([A-Z0-9])+-([0-9])+\\b', password: '***"', server: ''****', username: '****']

        return changeLogString
    }
    catch (Exception ex){
        def fullErrorMessage = "Unable to get changelog of '${gitUrl}: ${ex}"
        if(throwException){
            error fullErrorMessage
        }
        println fullErrorMessage
        return "<h1>Unable to get changelog of '${gitUrl}', check console output for more detailes</h1>"
    }

}
  • Expected result and actual result.
    We input tags to the git log and no commits are returned, and we get the same result (no commits) with these tags when we call the plugin with the post build actions on a freestyle job
    git log --pretty=oneline craton2-platform-sdk-5.13.1-beta2...craton2-platform-sdk-5.13.1-rc1 returns nothing
    same on the freestyle job
    image

but on the report of the pipeline created we get :
image

  • Any information from the logs:
    • Jenkins log:
Replayed #197
Started by user Dan Assael
Rebuilds build #202
Checking out git ssh://[email protected]/auto/swqa-jenkins-pipelines.git into /var/jenkins_home/workspace/Create_release_notes@script to read pipelines/create_release_notes.groovy
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://[email protected]/auto/swqa-jenkins-pipelines.git # timeout=10
Fetching upstream changes from ssh://[email protected]/auto/swqa-jenkins-pipelines.git
 > git --version # timeout=10
 > git --version # 'git version 2.11.0'
 > git fetch --tags --progress -- ssh://[email protected]/auto/swqa-jenkins-pipelines.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 21bda9e7b993d3f4170df34a22c1a52a3d7be1b8 (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 21bda9e7b993d3f4170df34a22c1a52a3d7be1b8 # timeout=10
Commit message: "tags specifically"
 > git rev-list --no-walk ce01baedea57a1a3888b86b1e981965b34958bcb # timeout=10
[Checks API] No suitable checks publisher found.
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] properties
[Pipeline] ansiColor
[Pipeline] {

[Pipeline] node
Running on ub04 in /local/jenkins/workspace/Create_release_notes
[Pipeline] {
[Pipeline] cleanWs
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] done
[Pipeline] stage
[Pipeline] { (get changes from device)
[Pipeline] git
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository ssh://[email protected]/sdk/device.git
 > git init /local/jenkins/workspace/Create_release_notes # timeout=10
Fetching upstream changes from ssh://[email protected]/sdk/device.git
 > git --version # timeout=10
 > git --version # 'git version 2.7.4'
 > git fetch --tags --progress ssh://[email protected]/sdk/device.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
Checking out Revision f0912699e5384d2362b35af3920171c4c010ff06 (refs/remotes/origin/master)
Commit message: "Fixed empty_tx processing in SECTON SPI master mode (PLAT-1174)"
 > git config remote.origin.url ssh://[email protected]/sdk/device.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git config core.sparsecheckout # timeout=10
 > git checkout -f f0912699e5384d2362b35af3920171c4c010ff06 # timeout=10
 > git branch -a -v --no-abbrev # timeout=10
 > git checkout -b master f0912699e5384d2362b35af3920171c4c010ff06 # timeout=10
 > git rev-list --no-walk f0912699e5384d2362b35af3920171c4c010ff06 # timeout=10
[Checks API] No suitable checks publisher found.
[Pipeline] sh
+ git log --pretty=oneline refs/tags/craton2-platform-sdk-5.13.1-beta2...refs/tags/craton2-platform-sdk-5.13.1-rc1
[Pipeline] gitChangelog
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (get changes from host)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (get changes from cv2x)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (get changes from DSRC DSP)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (get changes from CV2X DSP)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (get changes from platform)
[Pipeline] git
The recommended git tool is: NONE
No credentials specified
Fetching changes from the remote Git repository
 > git rev-parse --is-inside-work-tree # timeout=10
 > git config remote.origin.url ssh://[email protected]/plat/qnx.git # timeout=10
Fetching upstream changes from ssh://[email protected]/plat/qnx.git
 > git --version # timeout=10
 > git --version # 'git version 2.7.4'
 > git fetch --tags --progress ssh://[email protected]/plat/qnx.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision 07558168cc68ea5b52d9a1bec597df1f95f88538 (refs/remotes/origin/master)
Commit message: "Automatic merge from release/qnx-3.0.0 -> master"
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 07558168cc68ea5b52d9a1bec597df1f95f88538 # timeout=10
 > git branch -a -v --no-abbrev # timeout=10
 > git branch -D master # timeout=10
 > git checkout -b master 07558168cc68ea5b52d9a1bec597df1f95f88538 # timeout=10
 > git rev-list --no-walk 07558168cc68ea5b52d9a1bec597df1f95f88538 # timeout=10
[Checks API] No suitable checks publisher found.
[Pipeline] sh
+ git log --pretty=oneline qnx-dist-atlk-3.0.0-beta2...qnx-dist-atlk-3.0.0-rc1
3bbb041a916bd5984232c85c725cbb6f5bd871d4 add support for telent using PAM modole (bugfix/PLAT-902)
1e2de288dfca86047fd1d07db8a35a7d1d58c0bc Build only threadx when making distribution (PLAT-1175)
6016128466f52b0257de874c5df76bfabc71963d Ethernet: Worked around big files SCP fail (PLAT-350)
809e6b550b99a0e2d91e32ef53f6d2a81c68292d Prevent delivery of threadx (PLAT-1175)
27be29ae5f33fcdacf77a5267c02786c4664a64d DHCP client: Fixed initialization (PLAT-1152)
d6fb9105423b88af724e3e06ccfe014c783f2d1a Update m3-loader (PLAT-1169)
[Pipeline] gitChangelog
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (publish_html)
[Pipeline] writeFile
[Pipeline] publishHTML
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level /local/jenkins/workspace/Create_release_notes/reports to /var/jenkins_home/jobs/Create_release_notes/builds/203/htmlreports/Reports
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }

[Pipeline] // ansiColor
[Pipeline] End of Pipeline
[Checks API] No suitable checks publisher found.
Notified JIRA that a build has completed.
Finished: SUCCESS

Pipeline generator

Hi,

your docs state that this plugin supports pipeline generator, but after install and restart of jenkins it's not showing up there?

Do you have any other form of documentation that i can use to get my pipeline going?

Thanks

ParseException: Unexpected End Of File

Hi,

At least since 3.5 we encounter the following error message with most repositories:

net.minidev.json.parser.ParseException: Unexpected End Of File position : null

A downgrade to 3.2 resolved the issue. Didn't try with versions 3.3 and 3.4 that might also work.

Thank you!

Pipeline with render template when returning Context

Environment:

  • Jenkins ver. 2.150.1
  • Plugin verstion 2.16

When running a pipeline I'm interested if it's possible to run the gitChangelog Step and return context object but then use a Mustache template to render a string.

I know that the library behind the plugin has the builder object but i'm not sure if and how I should use it directly. The plugin step seems to do an abstraction of builder but I don't know if I can use it in my case.

Thanks

useJira: true does not work

Hello,

in freestyle job everything works, but I'm using scripted pipelines. The problem is that I can't get jira publish filter plugin working to get the list of jira issues mentioned between two commits, it just does not provide any output, but it generates changelog file pretty much correctly. Could you please advice what could be wrong when you have a time?

Thank you so much

https://pastebin.mozilla.org/9075305

Html incorrectly rendered in summary on job page

Hello,
I used the same template for both printing a summary on job page and create file (the one found here).
The file is created but when I open the job page, all html tag are visible and no rendering is done.
If I add to the a description using html tag, the description is rightly rendered.
7b37c364-0f55-11e7-842a-87a5757184d4

Any idea ?
Thank you

JIRA issues in branch name not showing up in changelog

This is the commits list on our master branch:

image

On a freestyle job,

image

and these are the reported issues:

(...)
Jira-Tickets mentioned in commits between 7.3.2 and 7.3.3-7:
NCO-7265,NCO-7504,NCO-7515
http://whatever.com/issues/?jql=key%20in%20%28NCO-7265,NCO-7504,NCO-7515%29
(...)

but for a pipeline script using the gitChangelog step:

echo "from " + previousTag + " to " + repositoryVersion

def changelogContext = gitChangelog returnType: 'CONTEXT',                       
    from: [type: 'REF', value: previousTag], 
    to: [type: 'REF', value: repositoryVersion]
                               
Set<String> issueIdentifiers = new TreeSet<>()
changelogContext.issues.each { issue ->
    if (issue.name == 'Jira') {
        issueIdentifiers.add(issue.issue)
    }
}

echo "found issues: ${issueIdentifiers}"

it only reports the following issue keys:

(...)
from 7.3.2 to 7.3.3-7
[Pipeline] gitChangelog
[Pipeline] }
[Pipeline] // dir
[Pipeline] echo
found issues: [NCO-7504]
(...)

am I doing something wrong?

Thanks in advance.
Luis

Nullpointer Exception on Firsttime Build

When you clone a remote Git repo the first time, a Nullpointer Exception occurs in the changelog plugin:

Cloning the remote Git repository
First time build. Skipping changelog.
---
--- Git Changelog ---
---

Creating changelog CHANGELOG.htmljava.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
	at com.google.common.base.Optional.of(Optional.java:84)
	at se.bjurr.gitchangelog.api.GitChangelogApi.getId(GitChangelogApi.java:480)
	at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:429)
	at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:77)
	at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:99)
	at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:123)
	at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:189)
	at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:29)
	at hudson.remoting.UserRequest.perform(UserRequest.java:207)
	at hudson.remoting.UserRequest.perform(UserRequest.java:53)
	at hudson.remoting.Request$2.run(Request.java:358)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1$1.run(Engine.java:98)
	at java.base/java.lang.Thread.run(Unknown Source)

Latest version is not rendering html on the build page

When reporting a bug, please try to provide as much information as possible.

  • Plugin version used. 2.10
  • Jenkins version used. 2.121.3

I just updated to 2.10. Previously rendering templates (a very lightly edited version of your default) is now being escaped instead of rendering, i.e.. is rendering as:

<h1> Git changelog </h1> <p> This is different from develop thusly: </p> <h2> Unreleased </h2> <h2> Jira EV-8400 </h2> <a href="https://repo.ourrepo.io/dev/javaapis/commit/af104092266bdf6">af104092266bdf6</a> Dev Name<i>2018-09-25 01:47:44</i> <p> <h3>EV-8400 fix broken tests</h3> </p>

{{title}} is not working

Plugin version used: 2.10
Jenkins version used: 2.141
Your configuration:
def previousReleaseVersion = getCurrentReleaseVersion(RELEASE)
def currentReleaseTag = "${RELEASE}/" + previousReleaseVersion
print "Current Release tag: ${currentReleaseTag}"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '*****',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']])
{
def changelogString = gitChangelog returnType: 'STRING',
from: [type: 'REF', value: "${currentReleaseTag}"],
to: [type: 'REF', value: 'master'],
ignoreCommitsIfMessageMatches: '^Merge.',
ignoreCommitsWithoutIssue: 'true',
jira: [issuePattern: 'CICD'+ '-([0-9]+)\b',password: "${PASSWORD}", server: 'https://jira.com', username: "${USERNAME}"],
template: """

           <!DOCTYPE html>
<title>Change Log</title> <style> h2 { text-decoration: underline; } table { border: 1px solid black; border-collapse: collapse; width: 100%; } th, td { border: 1px solid black; border-collapse: collapse; text-align: left; padding: 8px; } tr:nth-child(even){background-color: #f2f2f2} th { background-color: #0099cc; color: white; } </style>

Change Log for {{repoName}}

JOB NAME: ${JOB_NAME}

BUILD ID: ${BUILD_ID}

GIT BRANCH:${GIT_BRANCH}

{{#tags}}

{{name}}

{{#issues}}
{{#hasIssue}}

{{/hasIssue}} {{^hasIssue}} {{/hasIssue}} {{/issues}}
JIRA ID JIRA TITLE GIT MERGES
{{issue}} {{title}} {{#commits}} {{{messageTitle}}}
{{hash}} {{authorName}} {{commitTime}}

{{/commits}}

{{/tags}} """

Expected result and actual result.
Expected : the 2nd collum should fetch the JIRA ticket summary tab with JIRA issue ticlet no
Actual : blank
{{title}} is not working

Any information from the logs: There is no error in logs ๐Ÿ‘

Masking supported pattern matches of %USERNAME% or %PASSWORD%
[Pipeline] {
[Pipeline] gitChangelog
[Pipeline] writeFile
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // script

{{title}} is not printing

I am using git changelog plugin.When I am using :

{{name}} {{issue}} {{title}}

Below is getting printed ๐Ÿ‘ Ex- ๐Ÿ‘

Jira QW-10877

Instead of the summary of the ticket.How can i Print the summary from the Jira ticket using this plugin

Get changelog between last two tags

It will be nice to have an ability to get changelog between last and previous tags.
For example. I want to email about new releases, but I don't want to include in email all tags and all commits from the beginning. Just commits between current tag and previous tag.

commitTime showing incorrect date on new year

  • Plugin version used.
    2.21

  • Jenkins version used.
    2.190.1

  • Config in pipeline
    def changelogContext = gitChangelog returnType: 'CONTEXT',
    from: [type: 'COMMIT', value: 'commithash'],
    to: [type: 'REF', value: 'HEAD'],
    jira: [issuePattern: 'JIRAPATTERN-([0-9]+)\b', password: '', server: '', username: '']

    def tempMap
    def commitArray = []
    changelogContext.commits.each { commit ->
    tempMap = [id: commit.hashFull, commitTime: commit.commitTime]
    commitArray.add(tempMap)
    }
    println(JsonOutput.toJson(commits: commitArray))

  • Date shown on jenkins pipeline output
    {"id":commithash,"commitTime":"2020-12-30 20:28:20"}

  • Date shown when running the following command:
    git log -1 --pretty=format:"%H%x09%cd%x09%s commithash
    commithash Mon Dec 30 15:28:20 2019 -0500

Let me know if you need anything else to try and replicate. Thanks for your time!

CustomIssue not working in Pipeline

Hi,

I'm trying to use the gitChangeLog plugin in my jenkinsfile but the customIssue parameter seems to not work properly.
In the generated snippet, the parameter "pattern" is missing even if the field is properly set.
By adding it manually I still have a nullPointerExecption.

Here the script from my jenkinsfile

script {
	def changelog = gitChangelog ignoreCommitsWithoutIssue: false,
		customIssues:  [[link: '', name: 'Changed', pattern: 'Changed:', title: 'Changed']],
		removeIssueFromMessage: true, 
		returnType: 'STRING',
		untaggedName: 'Unreleased',
		template: """
		template
		"""
	echo "changelog"
}
     

& the output in Jenkins log

java.lang.NullPointerException: pattern
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
	at se.bjurr.gitchangelog.internal.settings.SettingsIssue.<init>(SettingsIssue.java:37)
	at se.bjurr.gitchangelog.api.GitChangelogApi.withCustomIssue(GitChangelogApi.java:158)
	at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.perform(GitChangelogStep.java:377)
	at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.access$000(GitChangelogStep.java:47)
	at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1.call(GitChangelogStep.java:325)
	at hudson.FilePath.act(FilePath.java:1096)
	at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:329)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
	at hudson.security.ACL.impersonate(ACL.java:290)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

  • Plugin version used - 2.3.
  • Jenkins version used - 2.117

ParseException: Unexpected End Of File

At least since 3.5 we encounter the following error message with most repositories:

net.minidev.json.parser.ParseException: Unexpected End Of File position : null

A downgrade to 3.2 resolved the issue. Didn't try with versions 3.3 and 3.4 that might also work.

Version report

Jenkins and plugins versions report:

Jenkins: 2.297
OS: Windows Server 2016 - 10.0

ace-editor:1.1
active-directory:2.24
all-changes:1.5
ansicolor:1.0.0
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
aws-credentials:1.29
aws-java-sdk:1.11.995
badge:1.8
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.24.7
blueocean-commons:1.24.7
blueocean-config:1.24.7
blueocean-core-js:1.24.7
blueocean-dashboard:1.24.7
blueocean-display-url:2.4.1
blueocean-events:1.24.7
blueocean-git-pipeline:1.24.7
blueocean-github-pipeline:1.24.7
blueocean-i18n:1.24.7
blueocean-jira:1.24.7
blueocean-jwt:1.24.7
blueocean-personalization:1.24.7
blueocean-pipeline-api-impl:1.24.7
blueocean-pipeline-editor:1.24.7
blueocean-pipeline-scm-api:1.24.7
blueocean-rest-impl:1.24.7
blueocean-rest:1.24.7
blueocean-web:1.24.7
blueocean:1.24.7
bootstrap4-api:4.6.0-3
bootstrap5-api:5.0.1-2
bouncycastle-api:2.20
branch-api:2.6.4
build-pipeline-plugin:1.5.8
build-timeout:1.20
build-user-vars-plugin:1.7
caffeine-api:2.9.1-23.v51c4e2c879c8
checks-api:1.7.0
cloudbees-bitbucket-branch-source:2.9.9
cloudbees-folder:6.15
command-launcher:1.6
conditional-buildstep:1.4.1
config-file-provider:3.8.0
convert-to-pipeline:1.0
copyartifact:1.46.1
credentials-binding:1.25
credentials:2.5
dashboard-view:2.17
display-url-api:2.3.5
docker-commons:1.17
docker-workflow:1.26
durable-task:1.37
echarts-api:5.1.2-2
email-ext:2.83
emailext-template:1.2
external-monitor-job:1.7
favorite:2.3.3
font-awesome-api:5.15.3-3
git-changelog:3.2
git-client:3.7.2
git-parameter:0.9.13
git-server:1.9
git:4.7.2
github-api:1.123
github-branch-source:2.11.1
github:1.33.1
gitlab-plugin:1.5.20
global-build-stats:1.5
groovy-postbuild:2.5
h2-api:1.4.199
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
http_request:1.9.0
jackson2-api:2.12.3
jacoco:3.2.0
javadoc:1.6
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.24.7
jira-steps:1.6.0
jira:3.3
jjwt-api:0.11.2-9.c8b45b8bb173
jobcacher:1.0
jquery-detached:1.2.1
jquery:1.12.4-1
jquery3-api:3.6.0-1
jsch:0.1.55.2
junit-attachments:1.6
junit:1.50
last-changes:2.7.10
ldap:2.7
lockable-resources:2.11
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.7
matrix-project:1.19
maven-plugin:3.11
mercurial:2.15
momentjs:1.1.1
okhttp-api:3.14.9
pam-auth:1.6
parameterized-trigger:2.41
pipeline-build-step:2.13
pipeline-github-lib:1.0
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-maven:3.10.0
pipeline-milestone-step:1.3.2
pipeline-model-api:1.8.5
pipeline-model-definition:1.8.5
pipeline-model-extensions:1.8.5
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.8.5
pipeline-stage-view:2.19
plain-credentials:1.7
plugin-util-api:2.3.0
popper-api:1.16.1-2
popper2-api:2.5.4-2
pubsub-light:1.15
resource-disposer:0.16
run-condition:1.5
saml:2.0.6
scm-api:2.6.4
script-security:1.77
skip-certificate-check:1.0
snakeyaml-api:1.29.1
sonar:2.13.1
sse-gateway:1.24
ssh-credentials:1.19
ssh-slaves:1.32.0
sshd:3.0.3
structs:1.23
subversion:2.14.3
timestamper:1.13
token-macro:2.15
trilead-api:1.0.13
variant:1.4
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:2.44
workflow-basic-steps:2.23
workflow-cps-global-lib:2.19
workflow-cps:2.92
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.24
workflow-remote-loader:1.5
workflow-scm-step:2.12
workflow-step-api:2.23
workflow-support:3.8
ws-cleanup:0.39
xray-for-jira-connector:1.3.0

Copy/paste here....
  • What Operating System are you using (both controller, and any agents involved in the problem)?

Windows Server 2016

Reproduction steps

def getChangeLogHTML(def gitRepoUrl, def gitRepoName, def gitTargetDir, def logType, def logFrom, def logTo, boolean updateIssues) {
    def stageName = this.stageName.capitalize()
    def result = ''
    try {
        withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'user',
                        usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
            def changelogContext = gitChangelog returnType: 'CONTEXT', repo: gitTargetDir,
                                                from: [type: logType, value: logFrom ],
                                                to: [type: logType, value: logTo ],
                                                jira: [
                                                    issuePattern: '\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b', 
                                                    server: this.JIRA_BASE_URL, 
                                                    username: env.USERNAME, 
                                                    password: env.PASSWORD
                                                ]

Results

Expected result:

Changelog from Git Repository

Actual result:

net.minidev.json.parser.ParseException: Unexpected End Of File position 639: null

output file does not expand environment variables and assumes root

Same configuration as in #25.

When trying to export publish JIRA Filter results to a file i add output.log but the plugin tries to write it to /outlog.log which naturally it does not have access to. It should use the current workspace directory.

Which brings me to the other problem, when adding the $WORKSPACE environment variable to the path then it is not expanded. Rather, we get /$WORKSPACE/output.log.

The plugin version is 2.7

Intermittent failures JSON parsing - the issue is not reproduced when same job rebuilt after some time.

Recently the git change log plugin starts failing intermittently with the following error stack:

net.minidev.json.parser.ParseException: Unexpected End Of File position 2251: null
19:49:28 at net.minidev.json.parser.JSONParserMemory.readString(JSONParserMemory.java:122)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:410)
19:49:28 at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:546)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:403)
19:49:28 at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:546)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:403)
19:49:28 at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:546)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:403)
19:49:28 at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:546)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:403)
19:49:28 at net.minidev.json.parser.JSONParserBase.readArray(JSONParserBase.java:273)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:406)
19:49:28 at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:546)
19:49:28 at net.minidev.json.parser.JSONParserBase.readMain(JSONParserBase.java:403)
19:49:28 at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:546)
19:49:28 at net.minidev.json.parser.JSONParserBase.readFirst(JSONParserBase.java:301)
19:49:28 at net.minidev.json.parser.JSONParserBase.parse(JSONParserBase.java:158)
19:49:28 at net.minidev.json.parser.JSONParserString.parse(JSONParserString.java:58)
19:49:28 at net.minidev.json.parser.JSONParser.parse(JSONParser.java:271)
19:49:28 at com.jayway.jsonpath.spi.json.JsonSmartJsonProvider.parse(JsonSmartJsonProvider.java:62)
19:49:28 Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (Jenkins-Slaves) - jenkins-slave(docker compose) (i-0af49e7a4434d79df)
19:49:28 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
19:49:28 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
19:49:28 at hudson.remoting.Channel.call(Channel.java:1001)
19:49:28 at hudson.FilePath.act(FilePath.java:1249)
19:49:28 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:358)
19:49:28 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
19:49:28 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
19:49:28 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
19:49:28 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
19:49:28 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
19:49:28 at java.base/java.lang.Thread.run(Thread.java:829)
19:49:28 Caused: com.jayway.jsonpath.InvalidJsonException
19:49:28 at com.jayway.jsonpath.spi.json.JsonSmartJsonProvider.parse(JsonSmartJsonProvider.java:64)
19:49:28 at com.jayway.jsonpath.internal.ParseContextImpl.parse(ParseContextImpl.java:37)
19:49:28 at com.jayway.jsonpath.JsonPath.read(JsonPath.java:498)
19:49:28 at se.bjurr.gitchangelog.internal.integrations.jira.JiraClient.toJiraIssue(JiraClient.java:38)
19:49:28 at se.bjurr.gitchangelog.internal.integrations.jira.DefaultJiraClient.getIssue(DefaultJiraClient.java:40)
19:49:28 at se.bjurr.gitchangelog.internal.issues.IssueParser.createParsedIssue(IssueParser.java:225)
19:49:28 at se.bjurr.gitchangelog.internal.issues.IssueParser.parseForIssues(IssueParser.java:82)
19:49:28 at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:585)
19:49:28 at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:83)
19:49:28 at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:109)
19:49:28 at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:140)
19:49:28 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.perform(GitChangelogStep.java:452)
19:49:28 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.access$000(GitChangelogStep.java:45)
19:49:28 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1.call(GitChangelogStep.java:354)
19:49:28 at hudson.remoting.UserRequest.perform(UserRequest.java:211)
19:49:28 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
19:49:28 at hudson.remoting.Request$2.run(Request.java:376)
19:49:28 at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
19:49:28 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
19:49:28 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
19:49:28 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
19:49:28 at java.base/java.lang.Thread.run(Thread.java:834)

The issue does not recur when rebuilt later on a new machine.

Using Context in scripted pipeline requires script security approvals

When using this plugin with returnType CONTEXT in a scripted pipeline, every model method has to be approved in the Script Security plugin. Otherwise, you get errors like:

Scripts not permitted to use method se.bjurr.gitchangelog.api.model.interfaces.ICommits getCommits. Administrators can decide whether to approve or reject this signature.

IMO all of the model methods should be whitelisted so manually approving them is not necessary,

Jenkins version: 2.141
Git Changelog plugin version: 2.9
Script Security plugin version: 1.46

Cannot get the GITCHANGELOGJIRA macro to work

Plugin version used.
Jenkins version: 2.121.3

The job in question publishes JIRA Filter as a second to last step.

Unable to pickup ${GITCHANGELOGJIRA} variable from the Confluence Publisher Plugin that comes right after in our build configuration. Other build environment variables and macros are used in the Confluence Publisher and expanded properly. Am i doing something wrong or is the TOKEN never exported to the build?

Jira title is not populated in git changelog output

When reporting a bug, please try to provide as much information as possible.

  • Plugin version used. 2.23
  • Jenkins version used. 2.204
  • Your configuration:
   def changelogString = gitChangelog returnType: 'STRING',
        from: [type: 'REF', value:latestTag],
        to: [type: 'REF', value:'HEAD'],
        ignoreCommitsIfMessageMatches: '^Merge.',
        ignoreCommitsWithoutIssue: 'true',
    jira:[issuePattern: 'CICD', password: '', server: '', username: '']
        template: """
# Changelog

Changelog for {{ownerName}} {{repoName}}.

{{#tags}}
## {{name}}
 {{#issues}}
  {{#hasIssue}}
   {{#hasLink}}
### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
   {{/hasLink}}
   {{^hasLink}}
### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
   {{/hasLink}}
  {{/hasIssue}}
  {{^hasIssue}}
### {{name}}
  {{/hasIssue}}

  {{#commits}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
 * {{.}} 
{{/messageBodyItems}}

[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

  {{/commits}}

 {{/issues}}
{{/tags}}
---
"""
  • Expected result and actual result.
    Output should contain jira title
  • Any information from the logs:
    java.lang.RuntimeException: No template specified
    at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.perform(GitChangelogStep.java:404)
    at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.access$000(GitChangelogStep.java:44)
    at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1.call(GitChangelogStep.java:322)
    at hudson.FilePath.act(FilePath.java:1162)
    at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:326)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    Finished: FAILURE

When I am using context then it doesn't show title.
Also let me know Is there any way to filter commit message title based on feature bugfix newchange"

Cannot get Jira issues titles after plugin update to version 2.19

  • Plugin version used.
    2.19 (updated from version 2.17)
  • Jenkins version used.
    2.190.1
  • Configuration:
    • Freestyle job

    • changelog template:

      {{#issues}}
      {{#hasIssue}}
      - {{issue}} - {{title}}
      {{/hasIssue}}
      {{^hasIssue}}
      - {{name}}
      {{/hasIssue}}
      {{/issues}}

    • Jira credentials provided from Jenkins credentials manager

  • Expected result:
    Generated changelog contains Jira issue title.
  • Actual result:
    Generated changelog doesn't contain Jira issue title.

Looks like after plugin update from version 2.17 to version 2.19 it's not logging in properly to Jira server. It's just my guess because plugin doesn't fail the job even if wrong credentials are provided. There is also no information in the logs about Jira login success/fail status.

Downgrading plugin to version 2.17 brings back the Jira integration functionality.

not compatible jGIT 5 (latest git client plug ins)

Hello,
I'm not 100% sure about the issue. Your plugins is great and worked smooth for a long time on an old Jenkins server. We rebuilt one from scratch and it does not work anymore. I'm using git changelog 2.21. The new server Git plugins is now 4.1.1, Git Client plugins is 3.1.1, while is was 2.8.0 on the old server

I get this error message :
ERROR: Step โ€˜Publish JIRA Filterโ€™ aborted due to exception:
java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.resolveRev(GitLogBetween.java:44)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getJGitLogBetween(GitLogBetween.java:32)

I found this on the wed, similar issue : https://issues.jenkins-ci.org/browse/JENKINS-53004
Seems like the conclusion is "reference to a symbol that JGit 4.x deprecated and JGit 5.x removed."

Not sure what this means โ€ฆ could it be the plugins needs a new revision to be compatible Git Client plug ins 3.1.1

Thanks for your help

please fix needed JAXB dependency for openjdk11

Environment:

Jenkins ver. 2.176
Plugin verstion 2.16

java --version openjdk 11.0.3 2019-04-16 LTS OpenJDK Runtime Environment 18.9 (build 11.0.3+7-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.3+7-LTS, mixed mode, sharing)

it's because java 11 droped "java.xml.bind", right now it's impossible to use "--add-modules java.xml.bind"

this can be fixed by adding neccessary dependency JAXB from jenkins:
JAXB-Plugin

Build log
15:08:21 --- Git Changelog --- 15:08:21 --- 15:08:28 java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter 15:08:28 at se.bjurr.gitchangelog.internal.integrations.rest.RestClient.withBasicAuthCredentials(RestClient.java:43) 15:08:28 at se.bjurr.gitchangelog.internal.integrations.jira.DefaultJiraClient.withBasicCredentials(DefaultJiraClient.java:22) 15:08:28 at se.bjurr.gitchangelog.internal.issues.IssueParser.createJiraClient(IssueParser.java:174) 15:08:28 at se.bjurr.gitchangelog.internal.issues.IssueParser.parseForIssues(IssueParser.java:60) 15:08:28 at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:456) 15:08:28 at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:77) 15:08:28 at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:99) 15:08:28 at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:123) 15:08:28 at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:148) 15:08:28 at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:26) 15:08:28 at hudson.remoting.UserRequest.perform(UserRequest.java:212) 15:08:28 at hudson.remoting.UserRequest.perform(UserRequest.java:54) 15:08:28 at hudson.remoting.Request$2.run(Request.java:369) 15:08:28 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 15:08:28 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 15:08:28 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 15:08:28 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 15:08:28 at java.base/java.lang.Thread.run(Thread.java:834)

2.20 not rendering html on the build page

Hello. I created stage for changelog page, but html template not rendering.
Plugin version 2.20

pipeline {
    agent { label 'agent' }
    stages {
        stage('build'){
            steps {
                echo 'build'
            }  
        }
        stage('update commits') {
            steps {
                script {
                    def changelogString = gitChangelog returnType: 'STRING',
                        from: [type: 'REF', value: 'staging'],
                        to: [type: 'REF', value: 'master'],
                        template: """
                                <h1> Git Changelog changelog </h1>

                                <p>
                                Changelog of Git Changelog.
                                </p>
                                
                                {{#tags}}
                                <h2> {{name}} </h2>
                                 {{#issues}}
                                  {{#hasIssue}}
                                   {{#hasLink}}
                                <h2> {{name}} <a href="{{link}}">{{issue}}</a> {{title}} </h2>
                                   {{/hasLink}}
                                   {{^hasLink}}
                                <h2> {{name}} {{issue}} {{title}} </h2>
                                   {{/hasLink}}
                                  {{/hasIssue}}
                                  {{^hasIssue}}
                                <h2> {{name}} </h2>
                                  {{/hasIssue}}
                                
                                
                                   {{#commits}}
                                <a href="https://github.com/user/repo/commit/{{hash}}">{{hash}}</a> {{authorName}} <i>{{commitTime}}</i>
                                <p>
                                <h3>{{{messageTitle}}}</h3>
                                
                                {{#messageBodyItems}}
                                 <li> {{.}}</li> 
                                {{/messageBodyItems}}
                                </p>
                                

                                  {{/commits}}
                                
                                 {{/issues}}
                                {{/tags}}
                                """
                    currentBuild.description = changelogString
                }
            }
         }
    }
}

Screenshot 2019-10-27 at 12 26 48

Screenshot 2019-10-27 at 12 28 29

JIRA updator

I've found this to be more accurate in terms of changes between successful builds. I've been using the update relevant JIRA issues plugin but when there are aborts/failures, Jenkins seems to lose track of the changes that would have been. Can I request an enhancement to also update the relevant JIRA tickets? (https://wiki.jenkins.io/display/JENKINS/JIRA+Plugin)

How to use this in scripted pipelines?

Hey,

thanks for closing my previous ticket so fast ;)

Could you please share examples how to use this plugin and specific features (like publish jira) when using scripted pipelines? You previously said it is possible, but I can't find example anywhere. Using DSL in my case is not possible for some reason, so scripted pipelines is the only option.

Thank you

gitChangelog step not working with slaves

Hi,

Newest gitChangelog step is not working with slaves.
It searches git repository on master.
Providing "repo" also doesn't helps. With repo: pwd(), it goes to D:\home\jenkinsUser\workspace. Without repo goes to D:\jenkinsHome.

  • Plugin version used - 2.0.0
  • Jenkins version used - 2.115
  • Expected result:
    Find git repository on slave
  • Actual result:
    Searches git repository on master.

Git change log plugin error RevisionSyntaxException in pipeline

  • Plugin version - 2.6

  • Jenkins version - 2.117

  • Configuration:
    def changelogString = gitChangelog from: [type: 'COMMIT', value: "${last}"], returnType: 'CONTEXT', template: '''
    <h1> Git Changelog changelog </h1>
    Changelog of Git Changelog.
    {{#tags}}
    {{name}}
    {{#commits}}
    {{hash}} {{authorName}} {{commitTime}}
    {{{messageTitle}}}
    {{#messageBodyItems}}
    <li> {{.}}</li>
    {{/messageBodyItems}}


    {{/commits}}
    {{/tags}}''', to: [type: 'COMMIT', value: "${previous}"]
    currentBuild.description = changelogString

  • Expected result: successful job with changelog in the description.

  • Actual result: failed job and no changelog in the description.

  • Build Logs:
    last: a8b43357b4bad35cf5f43315b087a00a8551ae5e # debug string
    Previous: a8b43357b4bad35cf5f43315b087a00a8551ae5e # debug string

[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (gather_changelog)
[Pipeline] gitChangelog
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
org.eclipse.jgit.errors.RevisionSyntaxException:a8b43357b4bad35cf5f43315b087a00a8551ae5e

at org.eclipse.jgit.lib.Repository.resolve(Repository.java:755)
at org.eclipse.jgit.lib.Repository.resolve(Repository.java:435)
at se.bjurr.gitchangelog.internal.git.GitRepo.getCommit(GitRepo.java:99)

Caused: se.bjurr.gitchangelog.api.exceptions.GitChangelogRepositoryException:
at se.bjurr.gitchangelog.internal.git.GitRepo.getCommit(GitRepo.java:101)
at se.bjurr.gitchangelog.api.GitChangelogApi.getId(GitChangelogApi.java:480)
at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:429)
at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:77)
at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.perform(GitChangelogStep.java:401)
at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.access$000(GitChangelogStep.java:47)
at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1.call(GitChangelogStep.java:325)
at hudson.FilePath.act(FilePath.java:1096)
at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:329)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

Pipeline/Job DSL configuration is confusing

The current configuration parameters are very hard to understand. What they do and how to use them...

For example. Should be possible to group some things into configuration objects where common parameters are stored for:

  • Creating a file
  • Printing on summary page
  • Publishing in MediaWiki
  • ...

There are also some unnecessary booleans like:

  • useGitLab - If gitlab is configured, use it!
  • useJiraUsernamePasswordCredentialsId - If there are supplied credentials, use them!
  • ...

Perhaps it can be implemented as a new attribute in GitChangelogRecorder. The current config can be deprecated and we can create a new changelogConfig with a better structure.

Since upgrading to 3.5 and then 3.7, the create file feature is not working.

Version report

Jenkins and plugins versions report:

Jenkins: 2.289.1
OS: Windows Server 2016 - 10.0
---
ace-editor:1.1
ant:1.11
antisamy-markup-formatter:2.1
any-buildstep:0.1
apache-httpcomponents-client-4-api:4.5.13-1.0
backup:1.6.1
bootstrap4-api:4.6.0-3
bootstrap5-api:5.0.1-2
bouncycastle-api:2.20
build-timestamp:1.0.3
caffeine-api:2.9.1-23.v51c4e2c879c8
changes-since-last-success:0.6
checks-api:1.7.0
command-launcher:1.6
conditional-buildstep:1.4.1
credentials-binding:1.25
credentials:2.5
display-url-api:2.3.5
echarts-api:5.1.2-2
email-ext:2.83
envinject-api:1.7
envinject:2.4.0
external-monitor-job:1.7
flexible-publish:0.16.1
font-awesome-api:5.15.3-3
git-changelog:3.7
git-client:3.7.2
git:4.7.2
github-api:1.123
github:1.33.1
htmlpublisher:1.25
jackson2-api:2.12.3
javadoc:1.6
jdk-tool:1.5
join:1.21
jquery-detached:1.2.1
jquery3-api:3.6.0-1
jsch:0.1.55.2
junit:1.50
ldap:2.7
mailer:1.34
matrix-auth:2.6.7
matrix-project:1.19
maven-plugin:3.11
msbuild:1.30
mstest:1.0.0
nunit:0.27
okhttp-api:3.14.9
pam-auth:1.6
parameterized-trigger:2.41
plain-credentials:1.7
plugin-util-api:2.3.0
popper-api:1.16.1-2
popper2-api:2.5.4-2
postbuildscript:2.11.0
run-condition:1.5
scm-api:2.6.4
script-security:1.77
seleniumhtmlreport:1.0
simple-queue:1.4.1
snakeyaml-api:1.29.1
ssh-credentials:1.19
sshd:3.0.3
structs:1.23
synopsys-coverity:2.4.1
test-results-analyzer:0.3.5
testng-plugin:1.15
thinBackup:1.10
token-macro:2.15
trilead-api:1.0.13
windows-slaves:1.8
workflow-api:2.44
workflow-cps:2.92
workflow-job:2.41
workflow-scm-step:2.12
workflow-step-api:2.23
workflow-support:3.8```

- What Operating System are you using (both controller, and any agents involved in the problem)?

PS C:\Users\Administrator.WIN-1Q8BGQHN6SP> [System.Environment]::OSVersion.Version

Major Minor Build Revision


10 0 14393 0

IE: WIndows Server 2016 64-bit


### Reproduction steps

<!--
- Write bullet-point reproduction steps.
- Be explicit about any relevant configuration, jobs, build history, user accounts, etc., redacting confidential information as needed.
- The best reproduction steps start with a clean Jenkins install, perhaps a `docker run` command if possible.
- Use screenshots where appropriate, copy textual output otherwise. When in doubt, do both.
- Include relevant logs, debug if needed - https://www.jenkins.io/doc/book/system-administration/viewing-logs/
-->

1. Create Freestyle project
2. Source Code Management
    1. Git
        1. Repository:   Choose your favorite repository
        2. Credentials:  Supply your credentials to your git repository
        3. Branches to build:   */develop       == in my case it is develop
3. Post-build Actions
    1. Git-changelog
        1. Choose from reference:   First commit in repo
        2. Choose 'to' reference:   develop    == in my case it is develop
        3. Pattern:  ^\[maven-release-plugin\].*|^\[Gradle Release Plugin\].*
        4. Create file:  check the box
            1. Filename:   CHANGELOG.html   ====   If stop here, you get first case below.
            2. Check "Use a template file from workspace" and enter:   CHANGELOGPlate.txt  
            3. Make sure file CHANGELOGPlate.txt exists in the workspace directory with the content:
                ```
                <h1> Git Changelog for branch "BRANCHNAME" </h1>  

                {{#commits}}
                {{#merge}}
                  <hr>
                  {{commitTime}} - <font size="+2"><b>{{{messageTitle}}}</b></font><br/>
                  <p>MERGEDESCRIPTION</p>
                {{/merge}}
                {{/commits}}
                ```  
                == This will give case 2 below.
            4. Uncheck the "Use a template file from workspace" box
            5. Check the "Configure template here" box instead.
            6. Enter the content of the CHANGELOGPLATE.txt file above.   ===   This actually works.

### Results

Expected result:

As given if all steps to 3.4.6 is applied above.
---
--- Git Changelog ---
---
Creating changelog CHANGELOG.html
Notifying upstream projects of job completion
Finished: SUCCESS

Actual result:
Case 1 if 3.4.1 is applied:   IE:  Only create file is checked.
---
--- Git Changelog ---
---
Creating changelog CHANGELOG.htmljava.lang.RuntimeException: changelog.mustache
	at se.bjurr.gitchangelog.api.GitChangelogApi.getTemplateString(GitChangelogApi.java:149)
	at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:104)
	at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:164)
	at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:168)
	at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:27)
	at hudson.FilePath.act(FilePath.java:1252)
	at org.jenkinsci.plugins.gitchangelog.perform.GitChangelogPerformer.performerPerform(GitChangelogPerformer.java:37)
	at org.jenkinsci.plugins.gitchangelog.GitChangelogRecorder.perform(GitChangelogRecorder.java:50)
	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
	at hudson.model.Build$BuildExecution.post2(Build.java:177)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
	at hudson.model.Run.execute(Run.java:1931)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.FileNotFoundException: Was unable to find file, or resouce, "changelog.mustache"
	at se.bjurr.gitchangelog.api.GitChangelogApi.getTemplateString(GitChangelogApi.java:142)
	... 18 more

Case 2 if 3.4.4 is applied above.   IE:  Using a template file.
---
--- Git Changelog ---
---
Creating changelog CHANGELOG.htmljava.lang.NullPointerException: The input is required.
	at com.github.jknack.handlebars.internal.lang3.Validate.notNull(Validate.java:225)
	at com.github.jknack.handlebars.Handlebars.compileInline(Handlebars.java:471)
	at com.github.jknack.handlebars.Handlebars.compileInline(Handlebars.java:453)
	at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:106)
	at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:164)
	at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:168)
	at org.jenkinsci.plugins.gitchangelog.perform.RemoteCallable.call(RemoteCallable.java:27)
	at hudson.FilePath.act(FilePath.java:1252)
	at org.jenkinsci.plugins.gitchangelog.perform.GitChangelogPerformer.performerPerform(GitChangelogPerformer.java:37)
	at org.jenkinsci.plugins.gitchangelog.GitChangelogRecorder.perform(GitChangelogRecorder.java:50)
	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
	at hudson.model.Build$BuildExecution.post2(Build.java:177)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
	at hudson.model.Run.execute(Run.java:1931)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)



NOTE:   This was all working prior to upgrade to version 3.5

WORKAROUND:    Put the template directly into the job as per 3.4.6 above.

REST client (used for Jira titles integrations, f.e.) does not respect proxy settings in Jenkins

  • Plugin version used: 2.10
  • Jenkins version used: 2.141
  • Your configuration:
    • Jenkins behind the proxy (proxy configured in Jenkins / Manage Plugins / Advanced / HTTP Proxy Configuration)

I am using "Use Jira" section in a configuration. I can see in general Jenkins log that RestClient is trying to connect to remote server and is getting "Connection Reset", it is common when Jenkins is sitting behind proxy and is not using configured settings from Jenkins.

Output from log:
Sep 17, 2018 7:52:55 AM INFO se.bjurr.gitchangelog.internal.integrations.rest.RestClient doGet GET: https://somedomainname.atlassian.net/rest/api/2/issue/TASK-2018?fields=parent,summary,issuetype,labels,description Sep 17, 2018 7:52:55 AM SEVERE se.bjurr.gitchangelog.internal.integrations.rest.RestClient doGet Got: null java.net.SocketException: Connection reset

Tested it on Jenkins instance on open network (no proxy), -- works like a charm (titles fetched and filled into change log).

Old commits being shown in the ChangeLog

When reporting a bug, please try to provide as much information as possible.

  • Plugin version used. --
  • Jenkins version used -- 2.176.3
  • Your configuration:
    • Template and any other relevant details.
  • Expected result and actual result.
  • Any information from the logs:

How to handle multiple issues in one commit message ?

I'm using Jenkins Changelog plugin, which also uses our Jira. I've determined the Jira issue pattern like this one: (WHIM-\d{4})
But the problem is that there are could be multiple Jira issues in one commit. How to handle all of them in a changelog template ?
I guess that in {{#issues}} section of template there should be some foreach loop to get every issue from a commit? Am I correct ? If yes then how to implement it ?

Capture Group Variables

Version report

Jenkins and plugins versions report:

Jenkins: 2.263.4
OS: Linux - 4.19.121-linuxkit

git-changelog:3.1

Reproduction steps

Hi, This is not so much a technical bug, but I cannot find in the documentation the plugins variable for PATTERN_GROUP_1, etc.

Is there a way to access the capture groups of the regular expression from objects such as customIssue? I see this is possible through git-changelog for other solutions.

Results

Expected result:

Actual result:

The ability to set param using the output of a capture group. for example:

INPUT = "12334:4321:MyIssueName-01:"

customIssues: [[name: 'ACME', issuePattern: '[a-zA-Z0-9]+:[a-zA-Z0-9]+:([a-zA-Z0-9-]+):', link: '', title: CAPTURE_GROUP_1 ]],

title = "MyIssueName-01"

Wrong info for {{ownerName}} and {{repoName}} when Repo name has '.' in it

Some of my repos have a period '.' in the name; instead of return the correct {{owner}} and {{repoName}} it returns the value before the '.' as the owner and the value after the '.' as the repoName.

  • Plugin: 2.7
  • Jenkins: 2.137
  • Your configuration:
def changelogString = gitChangelog from: [type: 'REF', value: "${Previous_Version}"], to: [type: 'REF', value: "${version}, "repo: ".\\${Application}", returnType: 'STRING', template: '''
# Changelog for {{ownerName}} {{repoName}}.
''']

currentBuild.description = changelogString
  • Expected result and actual result.
    • Result: "# Changelog for 5 0."
    • Expected: "# Changelog for Organization 5.0."

Missing Pull Request Merges in Git Changelog

The "Git Changelog" Publish Action works great in listing commits in the Jenkins Build Summary. However, it fails to list any of the Pull Request merges. Please see screenshots below of Actual Github Commits and the Jenkins Summary Page missing all the PR merges.

github_commits

jenkins_changelog

Jira Summary is not fetched

I am using below code :
{
def changelogString = gitChangelog returnType: 'STRING',
from: [type: 'REF', value: "${currentReleaseTag}"],
to: [type: 'REF', value: 'master'],
ignoreCommitsIfMessageMatches: '^Merge.',
ignoreCommitsWithoutIssue: 'true',
jira: [issuePattern: 'CICD'+ '-([0-9]+)\b',password: "${PASSWORD}", server: 'https://jira.com', username: "${USERNAME}"],
template: """

           <!DOCTYPE html>
<title>Change Log</title> <style> h2 { text-decoration: underline; } table { border: 1px solid black; border-collapse: collapse; width: 100%; } th, td { border: 1px solid black; border-collapse: collapse; text-align: left; padding: 8px; } tr:nth-child(even){background-color: #f2f2f2} th { background-color: #0099cc; color: white; } </style>

Change Log for {{repoName}}

JOB NAME: ${JOB_NAME}

BUILD ID: ${BUILD_ID}

GIT BRANCH:${GIT_BRANCH}

{{#tags}}

{{name}}

{{#issues}}
{{#hasIssue}}

{{/hasIssue}} {{^hasIssue}} {{/hasIssue}} {{/issues}}
JIRA ID JIRA TITLE GIT MERGES
{{issue}} ### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}} {{#commits}} {{{messageTitle}}}
{{hash}} {{authorName}} {{commitTime}}

{{/commits}}

{{/tags}}

But still not able to print the summary in 2nd collumn

Expected result - the 2nd collum should fetch the JIRA ticket summary tab with JIRA issue ticlet no
actual result - JIRA DE-10234

Unable to save job config when GIT Changelog plugin is used

I am unable to update/save Jenkins job configs that use the GIT Changelog plugin. After hitting save I get the following error message:

JSONObject["basicAuthString"] not found.
net.sf.json.JSONException: JSONObject["basicAuthString"] not found. at net.sf.json.JSONObject.getString(JSONObject.java:2040) at org.jenkinsci.plugins.gitchangelog.GitChangelogDescriptor.newInstance(GitChangelogDescriptor.java:83) at org.jenkinsci.plugins.gitchangelog.GitChangelogDescriptor.newInstance(GitChangelogDescriptor.java:17) at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:1076) at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:1038) at hudson.util.DescribableList.rebuildHetero(DescribableList.java:208) at hudson.model.Project.submit(Project.java:231) at hudson.model.Job.doConfigSubmit(Job.java:1336) at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:770) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212) at org.kohsuke.stapler.SelectionInterceptedFunction$Adapter.invoke(SelectionInterceptedFunction.java:36) at org.kohsuke.stapler.verb.HttpVerbInterceptor.invoke(HttpVerbInterceptor.java:48) at org.kohsuke.stapler.SelectionInterceptedFunction.bindAndInvoke(SelectionInterceptedFunction.java:26) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145) at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:676) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154) at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:113) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at org.jenkinsci.plugins.modernstatus.ModernStatusFilter.doFilter(ModernStatusFilter.java:52) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:153) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:54) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.Server.handle(Server.java:500) at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:543) at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:398) at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:161) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) at java.lang.Thread.run(Thread.java:748)

Plugin version used: 2.22

Jenkins version used: 2.222.1

Same error using default template/settings from changelog plugin or custom settings that worked in the past.

Removing the GIT Changelog post-build action from the config allows me to save the job.

JEP-200 net.minidev.json.JSONArray

Hi, folks.
I have a problem.
I configured pipeline with 'git changelog' plugin. And after starting the job, I got error JEP-200.

Plugin ver. 2.15
Jenkins ver. 2.121.3

pipeline
def changelogContext = gitChangelog returnType: 'CONTEXT', to: [type: 'REF', value: 'master'], jira: [password: "$PASSWORD", server: 'https://test.com', username: "$USERNAME"]

output
[Pipeline] gitChangelog [Pipeline] } [Pipeline] // withCredentials [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline java.lang.SecurityException: Rejected: net.minidev.json.JSONArray; see https://jenkins.io/redirect/class-filter/ at hudson.remoting.ClassFilter.check(ClassFilter.java:77) at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:135) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1868) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) at java.util.ArrayList.readObject(ArrayList.java:797) at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) at java.util.ArrayList.readObject(ArrayList.java:797) at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) at hudson.remoting.UserRequest.deserialize(UserRequest.java:291) at hudson.remoting.UserRequest$NormalResponse.retrieve(UserRequest.java:326) at hudson.remoting.Channel.call(Channel.java:955) Caused: java.io.IOException: Failed to deserialize response to UserRequest:org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1@29f41bb2 at hudson.remoting.Channel.call(Channel.java:963) at hudson.FilePath.act(FilePath.java:1126) at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:326) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE

Can you help me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.