[JIRA] (JENKINS-43563) Git plugin does not set user in pipeline

11 views
Skip to first unread message

lei.a.jiang@outlook.com (JIRA)

unread,
Jan 31, 2019, 7:16:02 PM1/31/19
to jenkinsc...@googlegroups.com
Lei JIANG commented on Bug JENKINS-43563
 
Re: Git plugin does not set user in pipeline

It that possible to prioritise this issue please. 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 1, 2019, 8:20:03 AM2/1/19
to jenkinsc...@googlegroups.com

[~leijiang please use the workaround described in the comment prior to your request. Because there is an easy work around, this will not be investigated further by me.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 1, 2019, 8:34:04 AM2/1/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-43563
[~leijiang ] please use the workaround [described in the comment|https://issues.jenkins-ci.org/browse/JENKINS-43563?focusedCommentId=310634&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-310634] prior to your request.  Because there is an easy work around, this will not be investigated further by me.

reitzmichnicht@gmx.de (JIRA)

unread,
Feb 1, 2019, 11:44:02 AM2/1/19
to jenkinsc...@googlegroups.com

Sorry this is not acceptable.
The documentation in https://plugins.jenkins.io/git clearly states that the plugin will do the user and email configuration. Do you know how much hours developers waste to find out that something that should work out of the box needs workarounds?
We have pipelines with more then 10 git checkouts where updates get pushed, so the pipeline scripts gets totally ugly.

dbeck@cloudbees.com (JIRA)

unread,
Feb 1, 2019, 11:56:02 AM2/1/19
to jenkinsc...@googlegroups.com

The documentation

It's sourced from a wiki page linked in the sidebar, everyone with an account can edit it. Users frequently contribute to that, and the changes are of varying quality. I'm sure Mark would appreciate your help in improving the quality of the documentation.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 1, 2019, 12:50:02 PM2/1/19
to jenkinsc...@googlegroups.com

Michael D I'm happy to receive a pull request with automated tests that show the problem and a code change that fixes the tests. Thanks for your interest in helping the Jenkins project!

apr_1985@hotmail.com (JIRA)

unread,
May 10, 2019, 4:20:03 AM5/10/19
to jenkinsc...@googlegroups.com

I have added a Warning on the https://wiki.jenkins.io/display/JENKINS/Git+Plugin page as I too wasted time trying to debug this issue.

michael@wyraz.de (JIRA)

unread,
May 15, 2019, 6:20:03 AM5/15/19
to jenkinsc...@googlegroups.com

Is it possible to access these settings programmatically in the pipeline?

michael@wyraz.de (JIRA)

unread,
May 15, 2019, 7:18:09 AM5/15/19
to jenkinsc...@googlegroups.com

Update: it is possible through the scm variable. So my workaround is:

def scmvars=steps.checkout(globals.scm)
{{ if (scmvars.GIT_AUTHOR_NAME && scmvars.GIT_AUTHOR_EMAIL) {}}
{{ steps.sh(script:"""}}
{{ git config user.name '${scmvars.GIT_AUTHOR_NAME}'}}
{{ git config user.email '${scmvars.GIT_AUTHOR_EMAIL}'}}
{{ """)}}
{{ }}}

michael@wyraz.de (JIRA)

unread,
May 15, 2019, 7:20:02 AM5/15/19
to jenkinsc...@googlegroups.com
Update: it is possible through the scm variable. So my workaround is:

{ { code}
def scmvars=steps.checkout(globals.scm) }}
{{ if (scmvars.GIT_AUTHOR_NAME && scmvars.GIT_AUTHOR_EMAIL) { }}
{{ steps.sh(script:""" }}
{{ git config user.name '${scmvars.GIT_AUTHOR_NAME}' }}
{{ git config user.email '${scmvars.GIT_AUTHOR_EMAIL}' }}
{{ """)
} }

{
{ code } }}

konrad_w@gmx.de (JIRA)

unread,
Jul 5, 2019, 3:49:02 AM7/5/19
to jenkinsc...@googlegroups.com

The workaround from above is not working though if only global git settings are used (not the per project behaviour). The according environment variables are not set if in that case.

Reply all
Reply to author
Forward
0 new messages