Commit 2d308c7d authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'revert-3c2cdc9a' into 'master'

Revert "Merge branch '31034-enable-zeitwerk' into 'master'"

See merge request gitlab-org/gitlab!27539
parents 24ef4be4 2d265218
...@@ -475,7 +475,7 @@ gem 'lograge', '~> 0.5' ...@@ -475,7 +475,7 @@ gem 'lograge', '~> 0.5'
gem 'grape_logging', '~> 1.7' gem 'grape_logging', '~> 1.7'
# DNS Lookup # DNS Lookup
gem 'gitlab-net-dns', '~> 0.9.1', require: 'net/dns' gem 'gitlab-net-dns', '~> 0.9.1'
# Countries list # Countries list
gem 'countries', '~> 3.0' gem 'countries', '~> 3.0'
......
...@@ -32,8 +32,6 @@ module Gitlab ...@@ -32,8 +32,6 @@ module Gitlab
config.active_record.sqlite3.represent_boolean_as_integer = true config.active_record.sqlite3.represent_boolean_as_integer = true
config.autoloader = :zeitwerk
# Sidekiq uses eager loading, but directories not in the standard Rails # Sidekiq uses eager loading, but directories not in the standard Rails
# directories must be added to the eager load paths: # directories must be added to the eager load paths:
# https://github.com/mperham/sidekiq/wiki/FAQ#why-doesnt-sidekiq-autoload-my-rails-application-code # https://github.com/mperham/sidekiq/wiki/FAQ#why-doesnt-sidekiq-autoload-my-rails-application-code
......
...@@ -42,7 +42,7 @@ Rails.application.configure do ...@@ -42,7 +42,7 @@ Rails.application.configure do
config.action_mailer.raise_delivery_errors = true config.action_mailer.raise_delivery_errors = true
# Don't make a mess when bootstrapping a development environment # Don't make a mess when bootstrapping a development environment
config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1') config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1')
config.action_mailer.preview_path = Rails.root.join('app', 'mailers', 'previews') config.action_mailer.preview_path = 'app/mailers/previews'
config.eager_load = false config.eager_load = false
......
...@@ -43,7 +43,7 @@ Rails.application.configure do ...@@ -43,7 +43,7 @@ Rails.application.configure do
# Print deprecation notices to the stderr # Print deprecation notices to the stderr
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
config.eager_load = false config.eager_load = true
config.cache_store = :null_store config.cache_store = :null_store
......
require_dependency 'gitlab'
# frozen_string_literal: true
Rails.autoloaders.each do |autoloader|
# We need to ignore these since these are non-Ruby files
# that do not define Ruby classes / modules
autoloader.ignore(Rails.root.join('lib/support'))
# Ignore generators since these are loaded manually by Rails
autoloader.ignore(Rails.root.join('lib/generators'))
autoloader.ignore(Rails.root.join('ee/lib/generators')) if Gitlab.ee?
# Mailer previews are also loaded manually by Rails
autoloader.ignore(Rails.root.join('app/mailers/previews'))
autoloader.ignore(Rails.root.join('ee/app/mailers/previews')) if Gitlab.ee?
# Ignore these files because these are only used in Rake tasks
# and are not available in production
autoloader.ignore(Rails.root.join('lib/gitlab/graphql/docs'))
autoloader.inflector.inflect(
'authenticates_2fa_for_admin_mode' => 'Authenticates2FAForAdminMode',
'api' => 'API',
'api_guard' => 'APIGuard',
'group_api_compatibility' => 'GroupAPICompatibility',
'project_api_compatibility' => 'ProjectAPICompatibility',
'cte' => 'CTE',
'recursive_cte' => 'RecursiveCTE',
'cidr' => 'CIDR',
'cli' => 'CLI',
'dn' => 'DN',
'hmac_token' => 'HMACToken',
'html' => 'HTML',
'html_parser' => 'HTMLParser',
'html_gitlab' => 'HTMLGitlab',
'http' => 'HTTP',
'http_connection_adapter' => 'HTTPConnectionAdapter',
'http_clone_enabled_check' => 'HTTPCloneEnabledCheck',
'chunked_io' => 'ChunkedIO',
'http_io' => 'HttpIO',
'json' => 'JSON',
'json_formatter' => 'JSONFormatter',
'json_web_token' => 'JSONWebToken',
'as_json' => 'AsJSON',
'ldap_key' => 'LDAPKey',
'mr_note' => 'MRNote',
'pdf' => 'PDF',
'rsa_token' => 'RSAToken',
'san_extension' => 'SANExtension',
'sca' => 'SCA',
'spdx' => 'SPDX',
'sql' => 'SQL',
'ssh_key' => 'SSHKey',
'ssh_key_with_user' => 'SSHKeyWithUser',
'ssh_public_key' => 'SSHPublicKey',
'git_push_ssh_proxy' => 'GitPushSSHProxy',
'git_user_default_ssh_config_check' => 'GitUserDefaultSSHConfigCheck',
'binary_stl' => 'BinarySTL',
'text_stl' => 'TextSTL',
'svg' => 'SVG',
'function_uri' => 'FunctionURI'
)
end
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
require 'settingslogic' require 'settingslogic'
require 'digest/md5' require 'digest/md5'
# We can not use `Rails.root` here, as this file might be loaded without the
# full Rails environment being loaded. We can not use `require_relative` either,
# as Rails uses `load` for `require_dependency` (used when loading the Rails
# environment). This could then lead to this file being loaded twice.
require_dependency File.expand_path('../lib/gitlab', __dir__)
class Settings < Settingslogic class Settings < Settingslogic
source ENV.fetch('GITLAB_CONFIG') { Pathname.new(File.expand_path('..', __dir__)).join('config/gitlab.yml') } source ENV.fetch('GITLAB_CONFIG') { Pathname.new(File.expand_path('..', __dir__)).join('config/gitlab.yml') }
namespace ENV.fetch('GITLAB_ENV') { Rails.env } namespace ENV.fetch('GITLAB_ENV') { Rails.env }
......
# frozen_string_literal: true # frozen_string_literal: true
return if Rails.env.production?
module Gitlab module Gitlab
module Graphql module Graphql
module Docs module Docs
......
# frozen_string_literal: true # frozen_string_literal: true
require 'gitlab/graphql/docs/helper' return if Rails.env.production?
module Gitlab module Gitlab
module Graphql module Graphql
......
# frozen_string_literal: true # frozen_string_literal: true
require 'webrick'
require 'prometheus/client/rack/exporter'
module Gitlab module Gitlab
module Metrics module Metrics
module Exporter module Exporter
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
return if Rails.env.production? return if Rails.env.production?
require 'graphql/rake_task' require 'graphql/rake_task'
require 'gitlab/graphql/docs/renderer'
namespace :gitlab do namespace :gitlab do
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference") OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
# We don't have auto-loading here # We don't have auto-loading here
require_relative '../lib/gitlab'
require_relative '../lib/gitlab/popen' require_relative '../lib/gitlab/popen'
require_relative '../lib/gitlab/popen/runner' require_relative '../lib/gitlab/popen/runner'
......
...@@ -11,9 +11,6 @@ require_relative '../config/settings' ...@@ -11,9 +11,6 @@ require_relative '../config/settings'
require_relative 'support/rspec' require_relative 'support/rspec'
require 'active_support/all' require 'active_support/all'
unless ActiveSupport::Dependencies.autoload_paths.frozen? ActiveSupport::Dependencies.autoload_paths << 'lib'
ActiveSupport::Dependencies.autoload_paths << 'lib' ActiveSupport::Dependencies.autoload_paths << 'ee/lib'
ActiveSupport::Dependencies.autoload_paths << 'ee/lib'
end
ActiveSupport::XmlMini.backend = 'Nokogiri' ActiveSupport::XmlMini.backend = 'Nokogiri'
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
require 'fogbugz'
describe Gitlab::FogbugzImport::Importer do describe Gitlab::FogbugzImport::Importer do
let(:project) { create(:project_empty_repo) } let(:project) { create(:project_empty_repo) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
require 'gitlab/graphql/docs/renderer'
describe Gitlab::Graphql::Docs::Renderer do describe Gitlab::Graphql::Docs::Renderer do
describe '#contents' do describe '#contents' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../app/services/service_response'
ActiveSupport::Dependencies.autoload_paths << 'app/services'
describe ServiceResponse do describe ServiceResponse do
describe '.success' do describe '.success' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment