Skip to content

Ruby 2: Ensure YAML.safe_load_file exists

Matthias Käppler requested to merge mk-yaml-safe-load-file into master

What does this MR do and why?

We are using YAML.safe_load_file in some places, but it only exists on Ruby 3. This currently fails Ruby 2 pipelines, e.g. https://gitlab.com/gitlab-org/gitlab/-/jobs/3861054630

Patch the YAML module for now until we are actually on Ruby 3, which should happen in the following weeks.

The same module leading to this failure was also mutating interpolated strings, which is not allowed in Ruby 2 if frozen-string-literals is set.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Matthias Käppler

Merge request reports