Skip to content

Enforce setting string as value of the CI/CD variable

What does this MR do?

Enforces Gitlab::Ci::Variables::Collection::Item#initialize to accept only String as value.

Are there points in the code the reviewer needs to double check?

The pipeline for this MR will discover all places in tests and in application, where we're using a non-string variable value. I've already found some of them and updated, but we will need to update the rest before merging this (if there is anything else).

Why was this MR needed?

Runner requires that the value will be sent as JSON string. Unfortunately we're not enforcing this when creating the variable, which finally may end with a stuck job that was assigned to the Runner, but Runner failed with Error decoding json payload json: cannot unmarshal number into Go struct field JobVariable.value of type string.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Fixes #48210 (closed)

Edited by Grzegorz Bizon

Merge request reports

Loading