Backport ActiveSupport safe_constantize fix to 19.4

What does this MR do and why?

This MR backports the upstream Rails fix for GHSA-8474-xrp6-wh69 to GitLab 19.4. With it, ActiveSupport::Inflector#safe_constantize matches the LoadError message as a literal string instead of compiling a regular expression from the requested constant name.

The default branch and 19.6 received the fix through the Rails 8.0.5.2 update in !269974 (merged). GitLab 19.4 runs Rails 7.2.3.1, and Rails released the fix in 8.0.5.2 and 8.1.4.1 only, so there is no Rails version this branch can update to. This MR therefore carries the upstream change as a patch prepended to ActiveSupport::Inflector.

The patch is pinned to activesupport 7.2.3.1. If Rails is ever updated on this branch, GitLab fails at boot with a message asking to remove the patch or check that it still applies.

Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/640096

MR acceptance checklist

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

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Merge request reports

Loading
Loading