Draft: Spike: Implement CI job inputs keyword
What does this MR do and why?
This MR is a spike demonstrating that we can use the existing Inputs validation classes to validate job inputs as well as config inputs.
Issue: Spike: Validate and persist CI job inputs (#560274 - closed)
Screenshots or screen recordings
A job with job inputs correctly interpolated:
test-job-inputs:
inputs:
test_string:
default: "hello i am a string"
test_boolean:
default: true
type: boolean
test_number:
default: 666
type: number
test_array:
default: ["item 1", "item 2"]
type: array
script:
- echo "Processing script"
- echo "${{ inputs.test_string }}"
- echo "${{ inputs.test_boolean }}"
- echo "${{ inputs.test_number }}"
- echo "${{ inputs.test_array }}"
tags:
- job-inputs
A linting error because a job input has not been given a default value. In the final version, users will get a different error message specifying that job inputs must have a default value.
Linting errors for different types of job input with incorrect default value types:
A linting error because a job input is given a default value not in the list of permitted options:
A linting error because a job input is given a default value that does not match the regex:
How to set up and validate locally
The screenshots for this MR were generated using the Runner PoC spike: Draft: POC: Expand job inputs into the user script (gitlab-runner!5600 - closed)






