[JIRA] (JENKINS-56977) Input "ChoiceParameterDefinition" with same name make the UI bug (select wrong choice when clicked)

5 views
Skip to first unread message

sylvain.targonski@gmail.com (JIRA)

unread,
Apr 11, 2019, 10:59:02 AM4/11/19
to jenkinsc...@googlegroups.com
Sylvain TARGONSKI created an issue
 
Jenkins / Bug JENKINS-56977
Input "ChoiceParameterDefinition" with same name make the UI bug (select wrong choice when clicked)
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: 2019-04-11 16_55_39-jenkins _ ec2_test _ master _ #43.png
Components: blueocean-plugin
Created: 2019-04-11 14:58
Environment: Jenkins 2.170
BlueOcean 1.14
Priority: Minor Minor
Reporter: Sylvain TARGONSKI

I'm using BlueOcean with declarative Pipelines. In one of my pipeline there is a step which executes a Jenkins "script" in which there is a jenkins "input" using parameter type "ChoiceParameterDefinition". It reads the choices from a variable which contains multiple lines : 

 

steps {
   script {
   def userInput = input(
      id: 'userInput', message: "mytest",
          parameters: [ 
          [$class: 'ChoiceParameterDefinition', choices: "${VAR_1}", name: 'config']
          ])
VAR_2 = "${userInput}"           
     }
} 

 

When there are choices composed of the exact same string, the UI bugs. The user is prompted with a choice list but when he clicks on the first choice it selects the second one and vice versa. 

I came accross this bug when I was doing some testings with the same string in each line of the variable. I'm not sure there is a real use case where you would like to have the choice between the "same" options but it should be easy to fix with at least an error saying that you can't have two choices which are the same for 'ChoiceParameterDefinition'.
Please find an attached screenshot where I clicked the first choice and it selected the second one.

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

gmogan@cloudbees.com (JIRA)

unread,
Apr 23, 2019, 3:12:02 PM4/23/19
to jenkinsc...@googlegroups.com

gmogan@cloudbees.com (JIRA)

unread,
Apr 23, 2019, 3:12:02 PM4/23/19
to jenkinsc...@googlegroups.com
Gavin Mogan commented on Bug JENKINS-56977
 
Re: Input "ChoiceParameterDefinition" with same name make the UI bug (select wrong choice when clicked)

I'm not sure what the problem is here, the example you have doesn't work on its own.

I got as far as 

  
pipeline {
    agent any
    stages {
        stage("Hello") {
            steps {
                script {
                    def userInput = input(
                      id: 'userInput', message: "mytest",
                          parameters: [ 
                          [$class: 'ChoiceParameterDefinition', choices: "${VAR_1}", name: 'config']
                          ])
                    VAR_2 = "${userInput}"           
                }
            }
        }
    }
}  

but thats missing VAR_1

Is this using declarative syntax? or the other one. 

I tried reproducing it on ci.blueocean.io but couldn't (set var_1 to "a\nb\nc\n")

 

https://ci.blueocean.io/blue/organizations/jenkins/Gavin%20Folder%2FJENKINS-56977%20-%20multiline%20choice/activity

gmogan@cloudbees.com (JIRA)

unread,
Apr 23, 2019, 3:13:03 PM4/23/19
to jenkinsc...@googlegroups.com
Gavin Mogan closed an issue as Cannot Reproduce
 

Feel free to re-open if you can provide a sample test case.

Change By: Gavin Mogan
Status: Open Closed
Resolution: Cannot Reproduce

sylvain.targonski@gmail.com (JIRA)

unread,
May 28, 2019, 9:02:02 AM5/28/19
to jenkinsc...@googlegroups.com
Larkoie reopened an issue
 

Hi,

The bug occurs when there are 2 items with the same name in your list.

In your example if you set var_1 to "a\na\nc\n" you will see the bug.

I know that having two items with the same name in a list is not really a "real life scenario" but I came across this bug while testing functionalities with dummy files and thought that it could be tested to throw an error instead of displaying these bugged select buttons.

Change By: Larkoie
Resolution: Cannot Reproduce
Status: Closed Reopened

sylvain.targonski@gmail.com (JIRA)

unread,
May 28, 2019, 9:03:04 AM5/28/19
to jenkinsc...@googlegroups.com
Hi,

The bug occurs when there are 2 items with the same name in your list.

In your example if you set var_1 to "a\na\nc\n" you will see the bug.

I know that having two items with the same name in a list is not really a "real life scenario" but I came across this bug while testing functionalities with dummy files and thought that it could be tested to throw an error instead of displaying these bugged select buttons.


 

To answer your other question : yes i'm using the declarative syntax

gmogan@cloudbees.com (JIRA)

unread,
May 28, 2019, 10:08:02 AM5/28/19
to jenkinsc...@googlegroups.com

Ah, thats how html works in the browser. I don't think its a scenario we need to support since as you said its not a real world example, but i guess it is still a bug.

Reply all
Reply to author
Forward
0 new messages