[JIRA] (JENKINS-57642) Wrong parameter type and squashing its content when trigger a job

31 views
Skip to first unread message

pjanouse@redhat.com (JIRA)

unread,
May 23, 2019, 8:48:03 AM5/23/19
to jenkinsc...@googlegroups.com
Pavel Janoušek created an issue
 
Jenkins / Bug JENKINS-57642
Wrong parameter type and squashing its content when trigger a job
Issue Type: Bug Bug
Assignee: Scott Hebert
Components: jms-messaging-plugin
Created: 2019-05-23 12:47
Priority: Major Major
Reporter: Pavel Janoušek

I have a job triggered by CI Event (JMS Messaging provider). The job has a declared parameter CI_MESSAGE of type Multi-line String Parameter, according the config.xml of the job, the parameter is

       <hudson.model.TextParameterDefinition>
          <name>CI_MESSAGE</name>
          <description></description>
          <defaultValue></defaultValue>
        </hudson.model.TextParameterDefinition>
 

When the job is triggered by this plugin, it very ofter puts the content of this parameter as a String, according the build.xml as:

        <hudson.model.StringParameterValue>
          <name>CI_MESSAGE</name>
          <value>...content...</value>
        </hudson.model.StringParameterValue>

although the definition in the same build.xml still says:

            <hudson.model.TextParameterDefinition>
              <name>CI_MESSAGE</name>
              <description></description>
              <defaultValue></defaultValue>
            </hudson.model.TextParameterDefinition>
          </parameterDefinitions>

Very rare the parameter is correctly stored in build.xml as:

        <hudson.model.TextParameterValue>
          <name>CI_MESSAGE</name>
          <description></description>
          <value>...content...</value>
        </hudson.model.TextParameterValue>

ans the definition is the same as previous.

UI is confused and String parameter has a far different rendering than Text parameter.

It is related to the other weird state - when it put the content of the parameter as String, it separate each key=value pair to separate line, when it put the content of the parameter as Text, it squash all pairs to the one line as:
Content from hudson.model.StringParameterValue:

<value>build=aaa
param2=128
url=foo</value>

Equal content from hudson.model.TextParameterValue:

<value>build=aaaparam2=128url=foo</value>

I don't know what is the source of CI_MESSAGE content, but it doesn't matter - the content type should be always TextParameter, not the other one (StringParameter).

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

pjanouse@redhat.com (JIRA)

unread,
May 23, 2019, 8:51:03 AM5/23/19
to jenkinsc...@googlegroups.com
Pavel Janoušek updated an issue
Change By: Pavel Janoušek
I have a job triggered by CI Event (JMS Messaging provider). The job has a declared parameter CI_MESSAGE of type Multi-line String Parameter, according the config.xml of the job, the parameter is
{code:java}

       <hudson.model.TextParameterDefinition>
          <name>CI_MESSAGE</name>
          <description></description>
          <defaultValue></defaultValue>
        </hudson.model.TextParameterDefinition>
{code}

When the job is triggered by this plugin, it very ofter puts the content of this parameter as a String, according the build.xml as:
{code:java}

        <hudson.model.StringParameterValue>
          <name>CI_MESSAGE</name>
          <value>...content...</value>
        </hudson.model.StringParameterValue>
{code}

although the definition in the same build.xml still says:
{code:java}

            <hudson.model.TextParameterDefinition>
              <name>CI_MESSAGE</name>
              <description></description>
              <defaultValue></defaultValue>
            </hudson.model.TextParameterDefinition>
          </parameterDefinitions>
{code}

Very rare the parameter is correctly stored in build.xml as:
{code:java}

        <hudson.model.TextParameterValue>
          <name>CI_MESSAGE</name>
          <description></description>
          <value>...content...</value>
        </hudson.model.TextParameterValue>
{code}
ans and the definition is the same as previous.


UI is confused and String parameter has a far different rendering than Text parameter.

It is related to the other weird state - when it put the content of the parameter as String, it separate each key=value pair to separate line, when it put the content of the parameter as Text, it squash all pairs to the one line as:
Content from hudson.model.StringParameterValue:
{code:java}

<value>build=aaa
param2=128
url=foo</value>
{code}
Equal content from hudson.model.TextParameterValue:
{code:java}
<value>build=aaaparam2=128url=foo</value>
{code}


I don't know what is the source of CI_MESSAGE content, but it doesn't matter - the content type should be always TextParameter, not the other one (StringParameter).

akostadinov@java.net (JIRA)

unread,
May 23, 2019, 10:47:02 AM5/23/19
to jenkinsc...@googlegroups.com
akostadinov commented on Bug JENKINS-57642
 
Re: Wrong parameter type and squashing its content when trigger a job

I'd like to add that this is a huge problem for the job rebuild plugin. Because it seems to respect the type given by the jms-messaging-plugin instead of config.xml. This removes new lines from text parameter so job can't be effectively rebuilt.

P.S. maybe second part of description needs to be changed because removing of new lines happens with String rather than Text param. Or possibly I misread it.

scoheb@gmail.com (JIRA)

unread,
May 23, 2019, 8:52:02 PM5/23/19
to jenkinsc...@googlegroups.com
Scott Hebert started work on Bug JENKINS-57642
 
Change By: Scott Hebert
Status: Open In Progress

pjanouse@redhat.com (JIRA)

unread,
May 24, 2019, 1:39:01 AM5/24/19
to jenkinsc...@googlegroups.com

No Aleks, I was surprised too... The second part of the description is correct, squashing is realized when TextParameterValue is used... The thing why you don't see a correct rendering in the second case (when StringParameterValue is used) is that even in this case you have pairs split by EOL, they are rendered as text input box content (single line). In build.xml they are stored correctly:

        <hudson.model.StringParameterValue>
          <name>CI_MESSAGE</name>
          <value>key1=val1
key2=val2
key3=val3</value>
        </hudson.model.StringParameterValue>

scoheb@gmail.com (JIRA)

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

Pavel Janoušek akostadinov

We were actually hardcoding the use of StringParameterValue instead of looking at what the job was using for its CI_MESSAGE parameter.

I am working on a fix with proper tests for this use case.

scoheb@gmail.com (JIRA)

unread,
May 25, 2019, 9:11:02 PM5/25/19
to jenkinsc...@googlegroups.com

scoheb@gmail.com (JIRA)

unread,
May 25, 2019, 9:28:02 PM5/25/19
to jenkinsc...@googlegroups.com

pjanouse@redhat.com (JIRA)

unread,
May 28, 2019, 4:09:12 AM5/28/19
to jenkinsc...@googlegroups.com
Pavel Janoušek commented on Bug JENKINS-57642
 
Re: Wrong parameter type and squashing its content when trigger a job

Thank you Scott Hebert for the quick fix. I don't have any job/workflow for JMS Messaging plugin, so can you akostadinov verify if it works for you please?

scoheb@gmail.com (JIRA)

unread,
Jun 5, 2019, 2:47:01 PM6/5/19
to jenkinsc...@googlegroups.com

pjanouse@redhat.com (JIRA)

unread,
Jun 7, 2019, 1:19:02 PM6/7/19
to jenkinsc...@googlegroups.com

scoheb@gmail.com (JIRA)

unread,
Nov 14, 2019, 10:26:03 AM11/14/19
to jenkinsc...@googlegroups.com
Change By: Scott Hebert
Status: In Review Resolved
Resolution: Fixed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages