jenkinsci / last-changes-plugin

https://plugins.jenkins.io/last-changes
https://plugins.jenkins.io/last-changes/
31 stars 28 forks source link

LAST_TAG not working #48

Open asherungar-ceva opened 6 years ago

asherungar-ceva commented 6 years ago

Hi,

i might be using it wrong but i want to see all changes between current build and last build that has a tag (any tag?), and if i understand correctly the "LAST_TAG" is according to the jenkins builds tags, not the git tags?

using the syntax below still only gives me changes since last build, not since the last tag. am i using it wrong? thanks Asher

using: def publisher = LastChanges.getLastChangesPublisher "LAST_TAG", "SIDE", "LINE", true, true, "", "", "", "", "" publisher.publishLastChanges() def changes = publisher.getLastChanges() println(changes.getEscapedDiff()) for (commit in changes.getCommits()) { println(commit) def commitInfo = commit.getCommitInfo() println(commitInfo) println(commitInfo.getCommitMessage()) println(commit.getChanges()) }

rmpestano commented 6 years ago

Hi,

the "LAST_TAG" is according to the jenkins builds tags, not the git tags?

it is based on the git tags, do you have a public git repo which the plugin is failing to get LAST_TAG?

rmpestano commented 6 years ago

Also, can you try via declarative pipeline DSL:

 post {
        always {
               lastChanges(since: 'LAST_TAG')
         }
}
asherungar-ceva commented 6 years ago

Hi, no, the repo is not public. do i just use the command line as above? or do i need to tell it which tag name to search for? and i want to get a list of commits since last tag. and lets say save them to a file for a different script to analyze them, if possible to also get which repo. something like:

repo 1 - 485ec8cb0b415119b99a29547530a3d0f6a01841 repo 2 - f4be30ebd93e35baaeb515947450723e61d9be8c

something like that.

asherungar-ceva commented 6 years ago

but let's start from the last_tag not working. i changed the lines i wrote in the first comment to just: lastChanges(since: 'LAST_TAG')

and still it just shows me changes from last build, not since the last tag on this git repo. i'm using the multi-branch pipeline plugin

rmpestano commented 6 years ago

i'm using the multi-branch pipeline plugin

Probably that's the issue, I don't have experience with multi-branch pipeline and never used nor tested the plugin in such situation.