Support specifying a CI/CD variable when defining a boolean type CI/CD input default
Proposal
When using CI/CD inputs, you can configure the input type as boolean.
This works fine when setting the input values in the .gitlab-ci.yml manually, for example.
# .gitlab-ci.yml
include:
- component: $CI_SERVER_FQDN/kballon-bug-report/zd648006_component_project/test-fail@main
inputs:
allow_failure: true
However if a CI/CD variable is use in the project like this:
# .gitlab-ci.yml
include:
- component: $CI_SERVER_FQDN/kballon-bug-report/zd648006_component_project/test-fail@main
inputs:
allow_failure: $RUN_ADVANCED_SAST # set to true in the project's CI/CD variable
It will raise this error as all variables are always treated as strings:
This GitLab CI configuration is invalid: `gitlab.com/<project_path>/<component>@<version>`: `<input_example>` input: provided value is not a boolean.
However, specifying a "boolean as string" directly also works:
# .gitlab-ci.yml
include:
- component: $CI_SERVER_FQDN/kballon-bug-report/zd648006_component_project/test-fail@main
inputs:
allow_failure: "true" # however, specifying "true123" does also raise an error
So while some processing seems to take place already that recognizes when a string is a valid representation of a boolean. Likely there is no variable expansion happening before this processing takes place, otherwise at least using variables that are known before pipeline execution time (e.g. project, group, instance variables) could work here.
Example
Edited by Manuel Grabowski