Add keyword to CI config for CI job inputs
What does this MR do and why?
This MR introduces the inputs keyword for jobs.
- It adds a
JobInputentry class that requires default values for job inputs - It adds inputs support to
Entry::Jobentry withCi::Inputs::Buildervalidation - It updates the CI JSON schema with
jobInputs. It extractsbaseInputJSON schema validations for use inconfigInputsandjobInputs - It extracts a
BaseInputmodule for shared input config validation logic
All of this work is done behind the new ci_job_inputs WIP feature flag
Issue: Add keyword to CI config for CI job inputs (#547440)
Spike MR: Draft: Spike: Implement CI job inputs keyword (!202106 - closed)
How to set up and validate locally
ci_job_inputs flag!
Here's a good config to use for testing:
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
If you place this config in the CI editor, you should see that it's valid:
Inputs with no default value should be invalid:
Errors should be surfaced properly for other invalid inputs:
If you run a pipeline with the config, you should see that it gets saved in the job's options:
Testing this further requires setting up the Runner PoC for job inputs. Follow the instructions in Draft: POC: Expand job inputs into the user script (gitlab-runner!5600 - closed).
Note: I don't expect reviewers to do this, but if you want to please ask me for further instructions



