Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/application.rb')
-rw-r--r--config/application.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb
index 6526be15cd4..06a5a726d92 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -32,7 +32,7 @@ module Gitlab
require_dependency Rails.root.join('lib/gitlab/middleware/rack_multipart_tempfile_factory')
require_dependency Rails.root.join('lib/gitlab/runtime')
- config.autoloader = :classic
+ config.autoloader = :zeitwerk
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
@@ -86,7 +86,11 @@ module Gitlab
# Rake tasks ignore the eager loading settings, so we need to set the
# autoload paths explicitly
config.autoload_paths = config.eager_load_paths.dup
+
+ # These are only used in Rake tasks so we don't need to add these to eager_load_paths
config.autoload_paths.push("#{config.root}/lib/generators")
+ Gitlab.ee { config.autoload_paths.push("#{config.root}/ee/lib/generators") }
+ Gitlab.jh { config.autoload_paths.push("#{config.root}/jh/lib/generators") }
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
@@ -168,6 +172,11 @@ module Gitlab
# like if you have constraints or database-specific column types
config.active_record.schema_format = :sql
+ # Dump all DB schemas even if schema_search_path is defined,
+ # so that we get the same db/structure.sql
+ # regardless if schema_search_path is set, or not.
+ config.active_record.dump_schemas = :all
+
# Use new connection handling so that we can use Rails 6.1+ multiple
# database support.
config.active_record.legacy_connection_handling = false
@@ -214,6 +223,7 @@ module Gitlab
config.assets.precompile << "page_bundles/jira_connect.css"
config.assets.precompile << "page_bundles/jira_connect_users.css"
config.assets.precompile << "page_bundles/learn_gitlab.css"
+ config.assets.precompile << "page_bundles/marketing_popover.css"
config.assets.precompile << "page_bundles/members.css"
config.assets.precompile << "page_bundles/merge_conflicts.css"
config.assets.precompile << "page_bundles/merge_requests.css"
@@ -264,7 +274,9 @@ module Gitlab
# Import path for EE specific SCSS entry point
# In CE it will import a noop file, in EE a functioning file
# Order is important, so that the ee file takes precedence:
+ config.assets.paths << "#{config.root}/jh/app/assets/stylesheets/_jh" if Gitlab.jh?
config.assets.paths << "#{config.root}/ee/app/assets/stylesheets/_ee" if Gitlab.ee?
+ config.assets.paths << "#{config.root}/app/assets/stylesheets/_jh"
config.assets.paths << "#{config.root}/app/assets/stylesheets/_ee"
config.assets.paths << "#{config.root}/vendor/assets/javascripts/"
@@ -422,6 +434,21 @@ module Gitlab
end
end
+ # Load JH initializers under JH. Load ordering is:
+ # 1. prepend_helpers_path
+ # 2. before_zeitwerk
+ # 3. let_zeitwerk_take_over
+ # 4. move_initializers
+ # 5. load_config_initializers
+ # 6. load_jh_config_initializers
+ Gitlab.jh do
+ initializer :load_jh_config_initializers, after: :load_config_initializers do
+ Dir[Rails.root.join('jh/config/initializers/*.rb')].sort.each do |initializer|
+ load_config_initializer(initializer)
+ end
+ end
+ end
+
# Add assets for variants of GitLab. They should take precedence over CE.
# This means if multiple files exist, e.g.:
#