Skip to content

Improve YAML variable validation message

What does this MR do and why?

Improve variable validation error message.

Screenshots or screen recordings

Previously, when specifying e.g. floating point numbers (18.04, 20.04 and 22.04 as in the UBUNTU_VERSION variable below), the error message hasn't been very clear to the user. The same goes when specifying no, yes, true, as illustrated by this issue where a number of people have been running into this: gitlab-foss#22648 (moved)

image

How to set up and validate locally

bundle exec rspec spec/lib/gitlab/ci/yaml_processor_spec.rb might help (and this test may actually need updating). I don't have a working GitLab development environment locally so haven't been able to validate it myself. 🤔

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports