parameter value set when it shouldn't be

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Bruno P. Kinoshita
            Reporter:
            Cyril Pottiers
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: