jenkinsci / ansible-plugin

Jenkins Ansible plugin
https://plugins.jenkins.io/ansible/
MIT License
227 stars 117 forks source link

"Add support for Boolean extra-var interpretation" This future makes it impossible to pass "true" and "false" string arguments to the script #248

Open zhengyongtao opened 3 months ago

zhengyongtao commented 3 months ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 24.10

Reproduction steps

                        extraVars: [
                            Tony: "true",
                            Alex: false,
                        ]

As in the example above, whether or not I add quotes to configure it as a string type, it will eventually be interpreted as a Boolean type. Causes the final parameters passed to the script to change from "true" and "false" to "True" and "False"

Expected Results

Correct pass string types "true" and "false"

Actual Results

The final parameters passed to the script to change from "true" and "false" to "True" and "False"

Anything else?

No response

Are you interested in contributing a fix?

No response

zhengyongtao commented 3 months ago

https://github.com/jenkinsci/ansible-plugin/pull/225/files The function that causes this exception is this code, which bluntly converts all "true" and "false" to Boolean types.