[JIRA] [git-changelog-plugin] (JENKINS-33301) git-changelog: specifying references

72 views
Skip to first unread message

martin.kulich@embedit.cz (JIRA)

unread,
Mar 3, 2016, 11:00:01 AM3/3/16
to jenkinsc...@googlegroups.com
Martin Kulich created an issue
 
Jenkins / Improvement JENKINS-33301
git-changelog: specifying references
Issue Type: Improvement Improvement
Assignee: Paul Wellner Bou
Components: git-changelog-plugin
Created: 03/Mar/16 3:59 PM
Environment: Jenkins: 1.642.1
git-changelog-plugin: 1.3
Labels: git plugin changelog
Priority: Minor Minor
Reporter: Martin Kulich

Hi!

It would be very helpful if the plugin could serve for generating changelog since last build / last successful build and so on.

It would include specifying 'from' reference as 'last successful build' / ... and 'to' reference as 'current build'.

Does it make sense? If I could be helpful with solving this ticket, please let me know.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

martin.kulich@embedit.cz (JIRA)

unread,
Mar 3, 2016, 11:02:01 AM3/3/16
to jenkinsc...@googlegroups.com
Martin Kulich updated an issue
Change By: Martin Kulich
Environment: Jenkins: 1.642.1
git-changelog-plugin: 1.
3 7

paul@wellnerbou.de (JIRA)

unread,
Mar 3, 2016, 11:28:01 AM3/3/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Hi Martin,

sure, this may make sense. But there is already a functionality in Jenkins showing you the changelog since the last build (not sure if you can tell him since last successful build though).
I will have a look into this anyhow.

This plugin is a combination of Thomas' and mine code, so there are two post build steps doing similar stuff, with different configuration and totally separated code behind, there is "Git changelog", "Publish git changelog" and "Publish JIRA filter".

Which post build action are you using?

martin.kulich@embedit.cz (JIRA)

unread,
Mar 3, 2016, 11:45:01 AM3/3/16
to jenkinsc...@googlegroups.com
Martin Kulich commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Hi Paul,
I know of the functionality Jenkins provides, however, it's not customizable in terms of specifying custom log format. I hoped I could use your plugin for that

I'm using "Git changelog" post-build action as it seems the most customizable.

paul@wellnerbou.de (JIRA)

unread,
Mar 3, 2016, 12:02:02 PM3/3/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Sure, it is possible to do that.

I assign this issue to Thomas, as this is his code. Although it would be cool to share at least part of the forms.
If I find the time, I will have a look into it.

paul@wellnerbou.de (JIRA)

unread,
Mar 3, 2016, 12:04:01 PM3/3/16
to jenkinsc...@googlegroups.com
Sure, it is possible to do that.

I  assign this issue  will try  to  Thomas  contact Tomas Bjerre , as this is his code. Although it would be cool to share at least part of the forms.

If I find the time, I will have a look into it.

paul@wellnerbou.de (JIRA)

unread,
Mar 3, 2016, 12:06:02 PM3/3/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou assigned an issue to Tomas Bjerre
Change By: Paul Wellner Bou
Assignee: Paul Wellner Bou Tomas Bjerre

tomas.bjerre85@gmail.com (JIRA)

unread,
Mar 3, 2016, 12:12:01 PM3/3/16
to jenkinsc...@googlegroups.com
Tomas Bjerre commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Are you using the Git Plugin? If so, you should be able to use the environment variables. Specify from commit as $

{GIT_COMMIT}

and to commit as $

{GIT_PREVIOUS_COMMIT}

https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

paul@wellnerbou.de (JIRA)

unread,
Mar 3, 2016, 12:20:03 PM3/3/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Tomas Bjerre: Sure, but that would not affect the "last build" or "last successful build".
I am quite sure you can do this with a groovy script and https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin, at least as workaround, somehow.

tomas.bjerre85@gmail.com (JIRA)

unread,
Mar 3, 2016, 12:23:03 PM3/3/16
to jenkinsc...@googlegroups.com
Tomas Bjerre edited a comment on Improvement JENKINS-33301
 
Re: git-changelog: specifying references
Are you using the Git Plugin? If so, you should be able to use the environment variables. Specify from commit as ${ GIT_COMMIT GIT_PREVIOUS_COMMIT } and to commit as ${ GIT_PREVIOUS_COMMIT GIT_COMMIT }

https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

tomas.bjerre85@gmail.com (JIRA)

unread,
Mar 4, 2016, 1:59:02 AM3/4/16
to jenkinsc...@googlegroups.com
Tomas Bjerre commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Martin Kulich: Is your problem solved with setting from GIT_PREVIOUS_COMMIT and to GIT_COMMIT?

Paul Wellner Bou: I dont understand what you mean here. He wrote "It would include specifying 'from' reference as 'last successful build' / ... and 'to' reference as 'current build'.
". And the from/to fields are expanded (https://github.com/jenkinsci/git-changelog-plugin/blob/master/src/main/java/org/jenkinsci/plugins/gitchangelog/perform/GitChangelogPerformer.java#L157) so the variables from Git Plugin should be available. I interpret the issue as if he wants to have this changelog on the current build, which is the one building GIT_COMMIT.

paul@wellnerbou.de (JIRA)

unread,
Mar 4, 2016, 2:06:02 AM3/4/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Tomas Bjerre: Maybe I am wrong: The GIT_PREVIOUS_COMMIT will expand to the previous commit (meaning HEAD^1), or to the commit of the last build of this same jenkins project? If the latter is the case, you would still have to find out the commit of the last successful build, if the last build wasn't.

tomas.bjerre85@gmail.com (JIRA)

unread,
Mar 4, 2016, 2:15:02 AM3/4/16
to jenkinsc...@googlegroups.com
Tomas Bjerre commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

GIT_PREVIOUS_COMMIT is the previous built commit, so perhaps HEAD^1 but it can be any parent.

Ok I see, i interpreted it as if he needed to have from as "successful" OR "not successful". Which is == true for GIT_PREVIOUS_COMMIT. He may use GIT_PREVIOUS_SUCCESSFUL_COMMIT to be sure that he uses the last successful.

paul@wellnerbou.de (JIRA)

unread,
Mar 4, 2016, 2:17:01 AM3/4/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Ok, thats great, didn't know this, will use this as well.
Thanks.

paul@wellnerbou.de (JIRA)

unread,
Mar 4, 2016, 2:17:01 AM3/4/16
to jenkinsc...@googlegroups.com
Paul Wellner Bou resolved as Fixed
Change By: Paul Wellner Bou
Status: Open Resolved
Assignee: Tomas Bjerre Martin Kulich
Resolution: Fixed

martin.kulich@embedit.cz (JIRA)

unread,
Mar 4, 2016, 3:00:01 AM3/4/16
to jenkinsc...@googlegroups.com
Martin Kulich commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Hi guys,
thank you both for your comments. I will definitely try the way Tomas suggests, I wasn't aware of the variables.

Maybe it would be helpful to mention it in docs?

Thanks again!

jirong.hu@gmail.com (JIRA)

unread,
Mar 15, 2016, 12:10:02 PM3/15/16
to jenkinsc...@googlegroups.com
Jirong Hu commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

GIT_PREVIOUS_SUCCESSFUL_COMMIT is not available, I only see these in my Windows environment:

GIT_BRANCH=origin/master
GIT_COMMIT=a781fbc49bda7083ebc05e28cee60de4e4258b17
GIT_PREVIOUS_COMMIT=a781fbc49bda7083ebc05e28cee60de4e4258b17
GIT_URL=http://github.ooop.com/DevOps/Sample.git

And I am having this issue: http://stackoverflow.com/questions/36016043/how-to-set-up-git-changelog-in-jenkins

tomas.bjerre85@gmail.com (JIRA)

unread,
Mar 15, 2016, 12:16:03 PM3/15/16
to jenkinsc...@googlegroups.com
Tomas Bjerre commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

I guess you are refering to the printout from "GIt Publisher". Try to use the variables in "Git Changelog" task.

jirong.hu@gmail.com (JIRA)

unread,
Mar 15, 2016, 2:03:02 PM3/15/16
to jenkinsc...@googlegroups.com
Jirong Hu commented on Improvement JENKINS-33301
 
Re: git-changelog: specifying references

Tomas Bjerre, I don't understand. My screenshot clearly has "Publish Git changelog" right under the Post-build actions, why you keep thinking I am using the Git Publisher? Git Publisher has a completely different UI.

jirong.hu@gmail.com (JIRA)

unread,
Mar 15, 2016, 2:12:01 PM3/15/16
to jenkinsc...@googlegroups.com
Jirong Hu edited a comment on Improvement JENKINS-33301
 
Re: git-changelog: specifying references
[~tomasbjerre],  All right,  I  don't understand  figured out .  My screenshot clearly has  I am using  "Publish Git changelog"  right under the Post-build actions ,  why you keep thinking I am using the  and there is another one called "  Git  Publisher? Git Publisher has a completely different UI  changelog" .  Thanks.

tomas.bjerre85@gmail.com (JIRA)

unread,
Mar 15, 2016, 2:14:02 PM3/15/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages