Audit what we put in initializers and consider moving some of them in a more correct place

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Currently we tend to throw a lot of stuff in initializers:

  • Monkey patches: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/0_as_concern.rb
  • Rails environment hacking: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/0_post_deployment_migrations.rb
  • Config validation: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/6_validations.rb
  • Set Rails environment values: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/default_url_options.rb
  • Plug rack middleware: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/etag_caching.rb
  • Show message to the end-user using view helpers: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/license.rb (see https://gitlab.com/gitlab-org/gitlab-ee/commit/8177803eec3956625eaf2a6def420d4540fcc3de#note_25058229)
  • Do weird stuff: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/config/initializers/math_lexer.rb

I think we should audit what we do here and act consequently (plan to be defined).

Edited Jun 15, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading