[JIRA] (JENKINS-40501) Reactive Reference Parameter not working with "List Subversion Tags" parameter

14 views
Skip to first unread message

christoph.obermair@gmx.at (JIRA)

unread,
Dec 16, 2016, 4:53:01 AM12/16/16
to jenkinsc...@googlegroups.com
Christoph Obermair created an issue
 
Jenkins / Improvement JENKINS-40501
Reactive Reference Parameter not working with "List Subversion Tags" parameter
Issue Type: Improvement Improvement
Assignee: Bruno P. Kinoshita
Components: active-choices-plugin
Created: 2016/Dec/16 9:52 AM
Priority: Minor Minor
Reporter: Christoph Obermair

I have a release build job on Jenkins where I extract extract the major+minor version numbers for the release from the chosen SVN release branch (provided as a "List Subversion Tags" parameter). This extraction is done as a groovy build step (using getTag() of hudson.scm.listtagsparameter.ListSubversionTagsParameterValue and split() of java.lang.String) which injects the major+minor version numbers as variables to build.

I now tried to provide the major+minor version number as build parameters using Reactive Reference Parameters (with choice type "Input Text Box") that should do this extraction in ther "Script" field of the parameter. Unfortunately I failed. When referring to a "List Subversion Tags" parameter I got an empty string. When returning the class of the referenced "List Subversion Tags" parameter to the text box I see the value "class java.lang.String". However, I would have expected something like "class hudson.scm.listtagsparameter.ListSubversionTagsParameterValue".

=> I am asking for a possibility to retrieve the string value of a "List Subversion Tags" parameter for Reactive Reference Parameters.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

christoph.obermair@gmx.at (JIRA)

unread,
Dec 16, 2016, 4:53:02 AM12/16/16
to jenkinsc...@googlegroups.com
Christoph Obermair updated an issue
Change By: Christoph Obermair
I have a release build job on Jenkins where I extract extract the major+minor version numbers for the release from the chosen SVN release branch (provided as a "List Subversion Tags" parameter). This extraction is done as a groovy build step (using getTag() of hudson.scm.listtagsparameter.ListSubversionTagsParameterValue and split() of java.lang.String) which injects the major+minor version numbers as variables to build.

I now tried to provide the major+minor version number as build parameters using Reactive Reference Parameters (with choice type "Input Text Box") that should do this extraction in ther "Script" field of the parameter. Unfortunately I failed. When referring to a "List Subversion Tags" parameter I got an empty string. When returning the class of the referenced "List Subversion Tags" parameter to the text box I see the value "class java.lang.String". However, I would have expected something like "class hudson.scm.listtagsparameter.ListSubversionTagsParameterValue".

=> I am asking for a possibility to retrieve the string value of a "List Subversion Tags" parameter for Reactive Reference Parameters.
Add Comment Add Comment
 

brunodepaulak@yahoo.com.br (JIRA)

unread,
Dec 16, 2016, 4:42:01 PM12/16/16
to jenkinsc...@googlegroups.com
Bruno P. Kinoshita commented on Improvement JENKINS-40501
 
Re: Reactive Reference Parameter not working with "List Subversion Tags" parameter

Hi Christoph Obermair, today I do not have time to try to reproduce the issue completely. But maybe a quick reply on this part would help?

>When returning the class of the referenced "List Subversion Tags" parameter to the text box I see the value "class java.lang.String". However, I would have expected something like "class hudson.scm.listtagsparameter.ListSubversionTagsParameterValue".

If I understand it correctly, your active choices parameter returned, when executing your Groovy script, value from another parameter as a String, opposed to an object from the Jenkins code base API.

That would be the expected behaviour. The plug-in works by parsing the HTML DOM. So it has access to only objects in the screen (plus the jenkinsProject variable we inject). So in an active choices parameter, the value returned from other parameters would be a string. And then in your Groovy script for that active choices parameter, you would have to query Jenkins in Groovy, retrieving the item/action/etc, and then populate the current active choices element.

Hope that helps
Bruno

brunodepaulak@yahoo.com.br (JIRA)

unread,
Mar 10, 2017, 6:03:05 PM3/10/17
to jenkinsc...@googlegroups.com
Bruno P. Kinoshita resolved as Not A Defect
 
Change By: Bruno P. Kinoshita
Status: Open Resolved
Resolution: Not A Defect
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

brunodepaulak@yahoo.com.br (JIRA)

unread,
Mar 10, 2017, 6:05:01 PM3/10/17
to jenkinsc...@googlegroups.com
 
Re: Reactive Reference Parameter not working with "List Subversion Tags" parameter

Closing as Not a Defect Christoph Obermair, as this is working as expected, given the current features of the plug-in.

From the String value, you will have to use Jenkins API in Groovy and navigate through the objects in Jenkins to reach your ListSubversionTagsParameterValue.

We are working in the next months to make the Scriptler integration better. So hopefully in the future we will be able to point users with similar issues to existing Scriptler scripts that can, at least, simplify this task.

Cheers
Bruno

rpatriar@gmail.com (JIRA)

unread,
Oct 23, 2018, 12:47:02 AM10/23/18
to jenkinsc...@googlegroups.com
remi P commented on Improvement JENKINS-40501

"When referring to a "List Subversion Tags" parameter I got an empty string."

That's the defect.

To reproduce:

  • create parametrized job
  • use a List Subversion tag parameter named "myTag"
  • try to reference $myTag parameter inside AC Reference Parameter plugin
  • you will get an empty string instead of the tag string value

Reproduced  with Jenkins 2.138.2,  Subversion plugin 2.12.1 and Active Choice plugin 2.1

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

rpatriar@gmail.com (JIRA)

unread,
Oct 23, 2018, 12:49:02 AM10/23/18
to jenkinsc...@googlegroups.com
remi P edited a comment on Improvement JENKINS-40501
"When referring to a "List Subversion Tags" parameter I got an empty string."

That's the defect.

To reproduce:
* create parametrized job
* use a List Subversion tag parameter named "myTag"
* try to reference $myTag parameter inside AC Reference Parameter plugin
* you will get an empty string instead of the tag string value


Reproduced  with Jenkins 2.138.2,  Subversion plugin 2.12.1 and Active Choice plugin 2.1


This issue should be reopened.

rpatriar@gmail.com (JIRA)

unread,
Oct 23, 2018, 12:51:21 AM10/23/18
to jenkinsc...@googlegroups.com
remi P edited a comment on Improvement JENKINS-40501
"When referring to a "List Subversion Tags" parameter I got an empty string."

That's the defect.

To reproduce:
* create a parametrized job

* use a List Subversion tag parameter named "myTag"
* try to reference $myTag parameter inside AC Reference Parameter plugin
* you will get an empty string instead of the tag string value

Reproduced  with Jenkins 2.138.2,  Subversion plugin 2.12.1 and Active Choice plugin 2.1

This issue should be reopened.

sergej.kleva@hermes-softlab.com (JIRA)

unread,
Dec 12, 2018, 7:11:02 AM12/12/18
to jenkinsc...@googlegroups.com

I do have the same problem!

Any news about this?

 

Thanks!

sergej.kleva@hermes-softlab.com (JIRA)

unread,
Dec 12, 2018, 7:11:02 AM12/12/18
to jenkinsc...@googlegroups.com

brunodepaulak@yahoo.com.br (JIRA)

unread,
Dec 12, 2018, 4:30:02 PM12/12/18
to jenkinsc...@googlegroups.com

brunodepaulak@yahoo.com.br (JIRA)

unread,
Dec 12, 2018, 4:30:02 PM12/12/18
to jenkinsc...@googlegroups.com
Bruno P. Kinoshita commented on Improvement JENKINS-40501
 
Re: Reactive Reference Parameter not working with "List Subversion Tags" parameter

Haven't had time to look into this after remi P's great comment with steps to reproduce. Let's reopen it. If anyone has time to investigate, pull requests welcome!

hoathenguyen85@gmail.com (JIRA)

unread,
Feb 26, 2020, 1:40:03 PM2/26/20
to jenkinsc...@googlegroups.com

Hi was looking into it as I want a solution to this.  I notice that when looking at the Subversion tag parameter field, it is getting the value before the field pulls data from SVN for list of tags.  So probably why it gets an empty string.

I think if it waited after the load, it would work.

I'll see if I can play with it.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

hoathenguyen85@gmail.com (JIRA)

unread,
May 1, 2020, 11:32:03 AM5/1/20
to jenkinsc...@googlegroups.com

Hi remi P,

Not sure if you are interested still, but I opted to not use to reference Jenkins svn tag params.  Instead I used the hudson.scm.listtagsparameter.ListSubversionTagsParameterDefinition class.

 

I used the following groovy script to get the string value.  I referenced a choice parameter that will pass the URL to pull tags from.  Only issue is that I could not get credential ID in scope of my project, only in scope at root level.  Other than that it works!

 

tag_param = new hudson.scm.listtagsparameter.ListSubversionTagsParameterDefinition('', TAG_URL, 'credential_id_here', '', '', '', false, false)
tag_param.getTags()

hoathenguyen85@gmail.com (JIRA)

unread,
May 1, 2020, 11:33:02 AM5/1/20
to jenkinsc...@googlegroups.com
Hoa Nguyen edited a comment on Improvement JENKINS-40501
Hi [~rpatriarche],

Not sure if you are interested still, but I opted to not use to reference Jenkins svn tag params
(I did not want to mess with JS to fix the loading data issue) .  Instead I used the hudson.scm.listtagsparameter.ListSubversionTagsParameterDefinition class.


 

I used the following groovy script to get the string value.  I referenced a choice parameter that will pass the URL to pull tags from.  Only issue is that I could not get credential ID in scope of my project, only in scope at root level.  Other than that it works!

 
{code:java}

tag_param = new hudson.scm.listtagsparameter.ListSubversionTagsParameterDefinition('', TAG_URL, 'credential_id_here', '', '', '', false, false)
tag_param.getTags()
{code}
Reply all
Reply to author
Forward
0 new messages