Skip to content

Fix issue with Gitlab::CurrentSettings and autoload/spring system

Brett Walker requested to merge bw-fix-autoload-issue into master

What does this MR do?

Adds a require_dependency Rails.root.join('lib/gitlab/current_settings') to the config/application.rb in order to ensure it's loaded before a variety of helper modules are loaded and could cause Unable to autoload constant. See https://gitlab.com/gitlab-org/gitlab-ee/issues/4842 for more details.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

This fixes an issue where the Rails autoload system would throw various Unable to autoload constant errors (such as Unable to autoload constant EE::ProjectsHelper) when using the autoload system (such with spring or reload! in the rails console.

This error was specifically ocurring in the EE code, however, it's seems reasonable to place the fix in CE as a general innoculation.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/4842

Edited by Brett Walker

Merge request reports