Add boolean and number CI inputs
What does this MR do and why?
This MR enables the use of the type
keyword with CI inputs and adds boolean and number types. (Previously, inputs could only be strings.)
Changelog: added
Screenshots or screen recordings
This .gitlab-ci.yml
file:
Includes this file that has a header defining one input of each valid type:
Which creates this successful job output:
Errors
Errors appear like this:
How to set up and validate locally
- Enable the
ci_interpolation_inputs_refactor
feature flag. The new inputs are not available in the legacy version of the CI inputs code - Add a file
included.yml
to a project:spec: inputs: test_string: type: string test_boolean: type: boolean test_number: type: number --- included_job: script: - echo $[[ inputs.test_string ]] - if [ $[[ inputs.test_boolean ]] ]; then echo "it's true!"; fi - echo $((8 * $[[ inputs.test_number ]]))
- In the pipeline editor, include
included.yml
and pass invalid input types to see that the validation works - Then pass valid input types and run a pipeline to see that the inputs are used correctly
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #390458 (closed)
Edited by Avielle Wolfe