Skip to content

Import missing library for regen-schema script

Alejandro Rodríguez requested to merge regenerate-schema-rainbow into master

What does this MR do and why?

Import missing library for regen-schema script

In !147182 (merged) we removed a deprecated task, that happened to be including the rainbow/ext/string lib. It seems that since Rails includes all rake files when loading tasks (see here https://github.com/rails/rails/blob/v7.0.8.1/railties/lib/rails/engine.rb#L661) this made the rainbow String extensions available for all other tasks. When we removed the deprecated task, we switched to including the library in our Rakefile, which also has the effect of making every invocation of rake have it loaded, but it doesn't cover the case of code that's not invoked through the rake task but that instead calls Gitlab::Application.load_tasks, like the regenerate-schema script. We thus now add the require explicitly here.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

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

Before After

How to set up and validate locally

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

Merge request reports