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

parameter value set when it shouldn't be

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • active-choices-plugin
    • None
    • Jenkins 2.504.1
      Active Choice Plugin 2.8.8

      In a build which contains an activeChoice checkbox param, there is a problem when the build is triggered by a push or any event that don't give any parameters.

      If the script that provide the checkbox list is in sandbox mode, then a default value of the environnement variable is filled with the first item value.

      Exemple with this simple Jenkinsfile :

      pipeline {
          agent any
          parameters {
            activeChoice(name: 'environnements', choiceType: 'PT_CHECKBOX', filterLength: 1, filterable: false, script: groovyScript(script: [sandbox: true, script: "return ['devA','devB','devC']", classpath: []]))
          }
          stages {
              stage('Hello') {
                  steps {
                      echo 'Parameters :'
                      sh "env -0 | sort -zfi | tr '\\0' '\\n' | sed 's/^/    /'"
                  }
              }
          }
      }
       

      The log provide to the environnements envvar the value "devA".

      environnements=devA

      Nota : By setting the sandbox to "false", this behaviour disappear and all is OK but not secured.

            kinow Bruno P. Kinoshita
            cpottiers Cyril Pottiers
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: