diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 00:08:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 00:08:48 +0300 |
commit | 4d0c47058a89d71d3417ad3bd73781882c8998e8 (patch) | |
tree | 808679f68ca8a8511d12779cf618785d6978be81 /config | |
parent | df2eda3f14dccb703bd7054d4ddde7803cb1fe7e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 7 | ||||
-rw-r--r-- | config/environments/test.rb | 3 | ||||
-rw-r--r-- | config/initializers/graphql.rb | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/config/application.rb b/config/application.rb index be7d366c927..2f4d271322f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -285,6 +285,13 @@ module Gitlab g.factory_bot false end + # This empty initializer forces the :let_zeitwerk_take_over initializer to run before we load + # initializers in config/initializers. This is done because autoloading before Zeitwerk takes + # over is deprecated but our initializers do a lot of autoloading. + # See https://gitlab.com/gitlab-org/gitlab/issues/197346 for more details + initializer :move_initializers, before: :load_config_initializers, after: :let_zeitwerk_take_over do + end + config.after_initialize do Rails.application.reload_routes! diff --git a/config/environments/test.rb b/config/environments/test.rb index d8235c6220c..0ee2c6a2a20 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,6 @@ +require 'gitlab/testing/request_blocker_middleware' +require 'gitlab/testing/request_inspector_middleware' + Rails.application.configure do # Make sure the middleware is inserted first in middleware chain config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestBlockerMiddleware) diff --git a/config/initializers/graphql.rb b/config/initializers/graphql.rb index 44a9644f481..81317a3d87a 100644 --- a/config/initializers/graphql.rb +++ b/config/initializers/graphql.rb @@ -6,8 +6,6 @@ GraphQL::Field.accepts_definitions(authorize: GraphQL::Define.assign_metadata_ke GraphQL::Schema::Object.accepts_definition(:authorize) GraphQL::Schema::Field.accepts_definition(:authorize) -Gitlab::Application.config.after_initialize do - GitlabSchema.middleware << GraphQL::Schema::TimeoutMiddleware.new(max_seconds: Gitlab.config.gitlab.graphql_timeout) do |timeout_error, query| - Gitlab::GraphqlLogger.error(message: timeout_error.to_s, query: query.query_string, query_variables: query.provided_variables) - end +GitlabSchema.middleware << GraphQL::Schema::TimeoutMiddleware.new(max_seconds: Gitlab.config.gitlab.graphql_timeout) do |timeout_error, query| + Gitlab::GraphqlLogger.error(message: timeout_error.to_s, query: query.query_string, query_variables: query.provided_variables) end |