[JIRA] (JENKINS-62165) Space character at end of parameter name prevents dereferencing this parameter

8 views
Skip to first unread message

SESA53268@se.com (JIRA)

unread,
May 5, 2020, 11:04:03 AM5/5/20
to jenkinsc...@googlegroups.com
Firmware Tools SE created an issue
 
Jenkins / Bug JENKINS-62165
Space character at end of parameter name prevents dereferencing this parameter
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2020-05-05 15:03
Environment: Jenkins LTS 2.222.3
Linux CentOS 7
Priority: Major Major
Reporter: Firmware Tools SE

When a space character is present at end of a parameter name, dereferencing this parameter name (without space) will display the string attemting the dereference (i.e. ${name}) instead of the value of this parameter.

 

Example of this problem:

  1. Create a job with a string parameter (e.g. "top_parameter"), but add a space at the end of the name like "top_parameter ", with a default value of anything (e.g. 42)
  2. use the parameter value, for example in a build step "Inject Environment variables" like : top_value=${top_parameter}
  3. use "top_value" environment variable (e.g. in a shell) ; its value will be the string "${top_parameter}" not 42
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
May 5, 2020, 5:29:03 PM5/5/20
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Not A Defect
 

Don't do that then.

Change By: Daniel Beck
Status: Open Closed
Resolution: Not A Defect

SESA53268@se.com (JIRA)

unread,
May 6, 2020, 3:04:02 AM5/6/20
to jenkinsc...@googlegroups.com
Firmware Tools SE reopened an issue
 

Okay, it seems I was misunderstood.

Adding a space after the parameter name on purpose was just for the sake of the example.

I spent quite some time figuring out some user had indeed mistakenly added a space behind a parameter name (probably a wrong copy/paste) in a weekly multijob (leading to failure of some parts of it).

So my request is: could it be possible to add some control on whether a parameter name has trailing (or even leading) "invisible" characters (maybe a warning or an automatic trimming (who, in his right mind, would want a trailing space in a parameter name?)).

 

Change By: Firmware Tools SE
Resolution: Not A Defect
Status: Closed Reopened

dbeck@cloudbees.com (JIRA)

unread,
May 6, 2020, 5:35:03 AM5/6/20
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-62165
 
Re: Space character at end of parameter name prevents dereferencing this parameter

Good point. While there are environments in which this can be desirable, they're rather unusual. So a form validation warning that points out unusual parameter names (also e.g. including a period in the name) that may not work well for some use cases, would be helpful.

dbeck@cloudbees.com (JIRA)

unread,
May 7, 2020, 4:07:03 PM5/7/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages