git-changelog-lib icon indicating copy to clipboard operation
git-changelog-lib copied to clipboard

Error while creating change log

Open Dhruva23 opened this issue 2 years ago • 11 comments

Getting below error

se.bjurr.gitchangelog.api.exceptions.GitChangelogRepositoryException .md file not found in jenkins workspace.

Git change log plugin version : 3.13

at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357) at hudson.remoting.Channel.call(Channel.java:1001) at hudson.FilePath.act(FilePath.java:1160) at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:338) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)

Jenkins version : 2.250

Dhruva23 avatar Nov 15 '21 09:11 Dhruva23

Are you sure there is not more stacktrace? How did you configure the plugin?

tomasbjerre avatar Nov 16 '21 15:11 tomasbjerre

Hi,

I have configured using Jenkins, manage plugins,

Dhruva23 avatar Nov 17 '21 03:11 Dhruva23

Even changelog.md is created in local work space, your help is much appreciated, with free style job, its working as expected, but in pipeline getting the above error.

Dhruva23 avatar Nov 17 '21 04:11 Dhruva23

Can you supply your pipeline code?

tomasbjerre avatar Nov 17 '21 05:11 tomasbjerre

def changelogString = gitChangelog returnType: 'STRING', from: [type: 'REF', value: 'CHANGELOG.md'], to: [type: 'REF', value: 'demo'],

demo is branch name

Dhruva23 avatar Nov 17 '21 06:11 Dhruva23

ref should be a branch or a tag. You probably dont have such a branch or tag named CHANGELOG.md.

tomasbjerre avatar Nov 17 '21 06:11 tomasbjerre

def changelogString = gitChangelog returnType: 'STRING', from: [type: 'REF', value: 'CHANGELOG.md'], to: [type: 'REF', value: 'demo'], template: """

Git Changelog changelog

Changelog of Git Changelog.

{{#tags}}

{{name}}

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

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

{{/hasLink}} {{^hasLink}}

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

{{/hasLink}} {{/hasIssue}} {{^hasIssue}}

{{name}}

{{/hasIssue}}

{{#commits}} {{hash}} {{authorName}} {{commitTime}}

{{{messageTitle}}}

{{#messageBodyItems}}

  • {{.}}
  • {{/messageBodyItems}}

    {{/commits}}

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

    Dhruva23 avatar Nov 17 '21 06:11 Dhruva23

    at se.bjurr.gitchangelog.internal.git.GitRepo.getRef(GitRepo.java:139) at se.bjurr.gitchangelog.api.GitChangelogApi.getId(GitChangelogApi.java:615) at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:567) at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:83) at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:109) at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:140) at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.perform(GitChangelogStep.java:422) at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.access$000(GitChangelogStep.java:45) at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1.call(GitChangelogStep.java:334) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:375) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73) 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)

    Dhruva23 avatar Nov 17 '21 06:11 Dhruva23

    ref should be a branch or a tag. You probably dont have such a branch or tag named CHANGELOG.md. Given some this like this def changelogString = gitChangelog returnType: 'STRING', from: [type: 'REF', value: 'demo'], to: [type: 'REF', value: 'demo'], thought build is successful, in workspace not able to find demo

    Dhruva23 avatar Nov 17 '21 08:11 Dhruva23

    am I missing some thing

    Dhruva23 avatar Nov 17 '21 09:11 Dhruva23

    managed to resolve issue, gitChangelog from: [type: 'REF', value: 'demo'], returnType: 'STRING', to: [type: 'REF', value: 'demo'] how to save it to changelog.md file, in free style job we can.

    Dhruva23 avatar Nov 22 '21 16:11 Dhruva23