[JIRA] (JENKINS-49758) when passing in ref_spec with build parameters, the exact string "$REF_SPEC" is used rather then the value

0 views
Skip to first unread message

sleungcy@gmail.com (JIRA)

unread,
Feb 26, 2018, 10:01:03 PM2/26/18
to jenkinsc...@googlegroups.com
sam leung created an issue
 
Jenkins / Bug JENKINS-49758
when passing in ref_spec with build parameters, the exact string "$REF_SPEC" is used rather then the value
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2018-02-27 03:00
Priority: Minor Minor
Reporter: sam leung

To replicate:

1) create a job and pass in refspec as build parameter e.g. "$GIT_REFSPEC"

2) use the parameter "$GIT_REFSPEC" as the SCM configuration for git-plugin

3) The build will use the exact string "$GIT_REFSPEC" rather than the actual value of $GIT_REFSPEC for the fetch operation.

For example:
01:26:08 using GIT_SSH to set credentials Gerrit SSH Key
01:26:08 > /usr/bin/git fetch --no-tags --progress ssh://[github-project-url] $GIT_REFSPEC --depth=2
01:31:43 > /usr/bin/git config remote.origin.url ssh://[github-project-url] # timeout=10
01:31:43 > /usr/bin/git config --add remote.origin.fetch $GIT_REFSPEC # timeout=10
 

I believe the .toString in this line is causing this problem:

https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L617

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

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

unread,
Feb 26, 2018, 10:05:01 PM2/26/18
to jenkinsc...@googlegroups.com

dcarreir@harris.com (JIRA)

unread,
Jul 27, 2018, 12:16:02 PM7/27/18
to jenkinsc...@googlegroups.com
Daniel Carreira commented on Bug JENKINS-49758
 
Re: when passing in ref_spec with build parameters, the exact string "$REF_SPEC" is used rather then the value

I believe I see a related issue when using pipelines.  I have a parameterized pipeline in SCM job. I want to use the parameter as the branch name in the git dialog but when the job is run the parameter is not expanded. If I do the same think in a freestyle job it works.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

giftigiftzwerg@web.de (JIRA)

unread,
Sep 26, 2019, 10:29:03 AM9/26/19
to jenkinsc...@googlegroups.com
Martin Weber updated an issue
 
Change By: Martin Weber
Priority: Minor Major
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

giftigiftzwerg@web.de (JIRA)

unread,
Sep 26, 2019, 10:33:03 AM9/26/19
to jenkinsc...@googlegroups.com

giftigiftzwerg@web.de (JIRA)

unread,
Sep 26, 2019, 10:35:03 AM9/26/19
to jenkinsc...@googlegroups.com

giftigiftzwerg@web.de (JIRA)

unread,
Sep 26, 2019, 10:37:04 AM9/26/19
to jenkinsc...@googlegroups.com
Martin Weber edited a comment on Bug JENKINS-49758
 
Re: when passing in ref_spec with build parameters, the exact string "$REF_SPEC" is used rather then the value
Updated to Major. Ran into the exact issue described in https://issues.jenkins-ci.org/browse/JENKINS-49834

!image-2019-09-26-16-32-02-026.png!

!image-2019-09-26-16-34-33-817.png!

The whole feature is essentially not working.

giftigiftzwerg@web.de (JIRA)

unread,
Sep 26, 2019, 10:37:05 AM9/26/19
to jenkinsc...@googlegroups.com

tamerlaha@gmail.com (JIRA)

unread,
Jan 15, 2020, 6:47:02 PM1/15/20
to jenkinsc...@googlegroups.com
ipleten commented on Bug JENKINS-49758

I see exact the same issue. parameter variable can't be resolved in "Branch to build".

Reply all
Reply to author
Forward
0 new messages