Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65485

Default value taken from display text instead of value

    XMLWordPrintable

Details

    Description

      When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

       Example:

      Script returns Map<Object, Object> containing versions of software the job needs to operate on:

      ['1.0.6': '1.0.6 (latest):selected',
       '1.0.5': 'chart:1.0.5, app:1.0.5', 
       '1.0.4': 'chart:1.0.4, app:1.0.3',
       '1.0.3': 'chart:1.0.3, app:1.0.2',
       '1.0.2': 'chart:1.0.2, app:1.0.1',
       '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT', 
       '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
      

      Impact:
      If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be 1.0.6 but instead 1.0.6 (latest) is returned back.

      Issue found here: https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290

       
      suggested fix: Use choices.keys()

      I can prepare the pull request, no problem. 

      Attachments

        Activity

          pjfila Pavel Fila created issue -
          pjfila Pavel Fila made changes -
          Field Original Value New Value
          Description When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected', 1.0.5=chart:1.0.5, app:1.0.5, 1.0.4=chart:1.0.4, app:1.0.3, 1.0.3=chart:1.0.3, app:1.0.2, 1.0.2=chart:1.0.2, app:1.0.1, 1.0.1=chart:1.0.1, app:1.0.1-SNAPSHOT, 1.0.0=chart:1.0.0, app:1.0.0-SNAPSHOT}{code}
          When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected', '1.0.5': 'chart:1.0.5, app:1.0.5', '1.0.4': 'chart:1.0.4, app:1.0.3', '1.0.3': 'chart:1.0.3, app:1.0.2', '1.0.2': 'chart:1.0.2', app:1.0.1', '1.0.1': 'chart:1.0.1', 'app:1.0.1-SNAPSHOT', '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT'}{code}
          pjfila Pavel Fila made changes -
          Description When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected', '1.0.5': 'chart:1.0.5, app:1.0.5', '1.0.4': 'chart:1.0.4, app:1.0.3', '1.0.3': 'chart:1.0.3, app:1.0.2', '1.0.2': 'chart:1.0.2', app:1.0.1', '1.0.1': 'chart:1.0.1', 'app:1.0.1-SNAPSHOT', '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT'}{code}
          When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
          '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1', 'app:1.0.1-SNAPSHOT',
          '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          pjfila Pavel Fila made changes -
          Description When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
          '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1', 'app:1.0.1-SNAPSHOT',
          '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          Impact:
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290

          ] [suggested fix: choices.keys()|https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
          pjfila Pavel Fila made changes -
          Description When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          Impact:
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290

          ] [suggested fix: choices.keys()|https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
          When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          Impact:
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
          suggested fix: choices.keys()

           
          pjfila Pavel Fila made changes -
          Description When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          Impact:
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
          suggested fix: choices.keys()

           
          When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          Impact:
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
           suggested fix: Use {{choices.keys()}}


          I can prepare the pull request, no problem. 
          pjfila Pavel Fila made changes -
          Description When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           

          Example:

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          Impact:
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
           suggested fix: Use {{choices.keys()}}


          I can prepare the pull request, no problem. 
          When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

           *Example:*

          Script returns Map<Object, Object> containing versions of software the job needs to operate on:
          {code:java}
          ['1.0.6': '1.0.6 (latest):selected',
           '1.0.5': 'chart:1.0.5, app:1.0.5',
           '1.0.4': 'chart:1.0.4, app:1.0.3',
           '1.0.3': 'chart:1.0.3, app:1.0.2',
           '1.0.2': 'chart:1.0.2, app:1.0.1',
           '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT',
           '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
          {code}
          *Impact:*
           If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be {{1.0.6}} but instead {{1.0.6 (latest)}} is returned back.

          Issue found here: [https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
           *suggested fix:* Use {{choices.keys()}}

          I can prepare the pull request, no problem. 

          People

            kinow Bruno P. Kinoshita
            pjfila Pavel Fila
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: