### 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.
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.
Version report
Jenkins and plugins versions report:
PS C:\Users\Administrator.WIN-1Q8BGQHN6SP> [System.Environment]::OSVersion.Version
Major Minor Build Revision
10 0 14393 0
IE: WIndows Server 2016 64-bit
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.