[go: up one dir, main page]

Skip to content

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

Screenshot 2025-08-21 at 15.50.01.png

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.

Screenshot 2025-08-21 at 15.14.08.png

Linting errors for different types of job input with incorrect default value types:

Screenshot 2025-08-21 at 15.16.55.png

Screenshot 2025-08-21 at 15.17.06.png

Screenshot 2025-08-21 at 15.17.19.png

A linting error because a job input is given a default value not in the list of permitted options:

Screenshot 2025-08-21 at 15.14.56.png

A linting error because a job input is given a default value that does not match the regex:

Screenshot 2025-08-21 at 15.15.53.png

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)

Edited by Avielle Wolfe

Merge request reports

Loading