Remove usage of autoloader in initializers
Rails 6 deprecation message when booting the app when not eager loading:
DEPRECATION WARNING: Initialization autoloaded the constants Gitlab::Patch, Gitlab::Patch::Prependable, Gitlab::Marginalia, Gitlab::Marginalia::Comment, Gitlab::Marginalia::ActiveRecordInstrumentation, Gitlab::Metrics::Methods, Gitlab::Metrics::InfluxDb, Gitlab::Utils::StrongMemoize, Gitlab::Metrics::Prometheus, Gitl
ab::Metrics, EE, EE::Gitlab, Gitlab::Utils::Override, EE::Gitlab::Database, Gitlab::Database, Gitlab::ThreadMemoryCache, EE::Gitlab::Access, Gitlab::Access, Gitlab::Themes, Gitlab::VisibilityLevel, Gitlab::GithubImport, EE::Gitlab::GithubImport, EE::Gitlab::GithubImport::ParallelImporter, Gitlab::GithubImport::Parall
elImporter, Gitlab::BitbucketImport, Gitlab::ShellAdapter, Gitlab::BitbucketImport::Importer, Gitlab::BitbucketServerImport, Gitlab::BitbucketServerImport::Importer, Gitlab::GitlabImport, Gitlab::GitlabImport::Importer, Gitlab::GoogleCodeImport, Gitlab::GoogleCodeImport::Importer, Gitlab::FogbugzImport, Gitlab::FogbugzImport::Importer, EE::Gitlab::ImportExport, Gitlab::ImportExport, Gitlab::Allowable, EE::Gitlab::ImportExport::Importer, Gitlab::ImportExport::Importer, Gitlab::LegacyGithubImport, Gitlab::LegacyGithubImport::Importer, Gitlab::PhabricatorImport, Gitlab::PhabricatorImport::Importer, EE::Gitlab::ImportSources, Gitlab::ImportSources, Gitlab::ContentSecurityPolicy, Gitlab::ContentSecurityPolicy::ConfigLoader, Gitlab::NullRequestStore, Gitlab::SafeRequestStore, ApplicationRecord, CacheableAttributes, CacheMarkdownField, Gitlab::MarkdownCache, Gitlab::MarkdownCache::FieldData, Gitlab::MarkdownCache::ActiveRecord, Gitlab::MarkdownCache::ActiveRecord::Extension, TokenAuthenticatable, ChronicDurationAttribute, TokenAuthenticatableStrategies, TokenAuthenticatableStrategies::Base, TokenAuthenticatableStrategies::Encrypted, TokenAuthenticatableStrategies::Insecure, KeyRestrictionValidator, ApplicationSettingImplementation, DurationValidator, QualifiedDomainArrayValidator, AddressableUrlValidator, DeviseEmailValidator, Gitlab::JwtAuthenticatable, Gitlab::Pages, Gitlab::EncodingHelper, Gitlab::Git, Gitlab::Git::Diff, JsRegexValidator, EE::Gitlab::Regex, Gitlab::Regex, X509CertificateCredentialsValidator, EE::ApplicationSetting, ApplicationSetting, Gitlab::GitalyClient, Gitlab::TemporarilyAllow, Gitlab::GitalyClient::StorageSettings, Gitlab::VersionInfo, Gitlab::Shell, Prometheus::PidProvider, Gitlab::Metrics::RequestsRackMiddleware, EE::Gitlab::Auth, Gitlab::Auth, Gitlab::Auth::LDAP, EE::Gitlab::Auth::LDAP, EE::Gitlab::Auth::LDAP::Config, Gitlab::Auth::LDAP::Config, EE::Gitlab::OmniauthInitializer, Gitlab::OmniauthInitializer, Gitlab::I18n, Gitlab::Patch::ActionDispatchJourneyFormatter, Gitlab::Email, Gitlab::Email::Hook, Gitlab::Email::Hook::AdditionalHeadersInterceptor, Gitlab::Email::Hook::EmailTemplateInterceptor, Gitlab::Email::Hook::DeliveryMetricsObserver, Gitlab::Cluster, Gitlab::Cluster::LifecycleEvents, Banzai, Banzai::Filter, Banzai::Filter::AssetProxyFilter, Gitlab::MultiDestinationLogger, Gitlab::Logger, Gitlab::AppTextLogger, Gitlab::JsonLogger, Gitlab::AppJsonLogger, Gitlab::AppLogger, Gitlab::Geo, Gitlab::ConfigHelper, Gitlab::SQL, Gitlab::SQL::Pattern, AfterCommitQueue, Avatarable, ObjectStorage, FileSizeValidator, GitlabUploader, Gitlab::FileTypeDetection, Gitlab::FileMarkdownLinkBuilder, UploaderHelper, RecordsUploads, EE::ObjectStorage, UploadTypeCheck, AvatarUploader, Referable, Sortable, CaseSensitivity, FeatureGate, CreatedAtFilterable, BulkMemberAccessLoad, BlocksJsonSerialization, FastDestroyAll, WithUploads, OptionallySearch, FromUnion, BatchDestroyDependentAssociations, AuditorUserHelper, EE::User, User, RedirectUriValidator, GemExtensions, GemExtensions::Elasticsearch, GemExtensions::Elasticsearch::Model, GemExtensions::Elasticsearch::Model::Response, GemExtensions::Elasticsearch::Model::Response::Records, GemExtensions::Elasticsearch::Model::Adapter, GemExtensions::Elasticsearch::Model::Adapter::Multiple, GemExtensions::Elasticsearch::Model::Adapter::Multiple::Records, GemExtensions::Elasticsearch::Model::Indexing, GemExtensions::Elasticsearch::Model::Indexing::InstanceMethods, GemExtensions::Elasticsearch::Model::Adapter::ActiveRecord, GemExtensions::Elasticsearch::Model::Adapter::ActiveRecord::Importing, GemExtensions::Elasticsearch::Model::Client, Gitlab::EtagCaching, Gitlab::EtagCaching::Middleware, Shard, Gitlab::JsonCache, EE::Feature, Feature, Presentable, Geo, Geo::SelectiveSync, StripAttribute, GeoNode, Gitlab::Workhorse, Routable, Storage, Storage::LegacyNamespace, AbstractPathValidator, NamespacePathValidator, Plan, License, EE::Namespace, EachBatch, Namespace, EE::Gitlab::PathRegex, Gitlab::PathRegex, Gitlab::Middleware::Go, Gitlab::Graphql, Gitlab::Graphql::Authorize, Gitlab::Graphql::Present, Gitlab::Graphql::CallsGitaly, Gitlab::Graphql::Connections, Gitlab::Graphql::GenericTracing, Gitlab::Graphql::QueryAnalyzers, Gitlab::Graphql::QueryAnalyzers::LoggerAnalyzer, Gitlab::Graphql::QueryAnalyzers::RecursionAnalyzer, Types, Gitlab::Graphql::ExposePermissions, Gitlab::Graphql::MarkdownField, Types::BaseField, Types::BaseObject, Types::PermissionTypes, Types::PermissionTypes::BasePermissionType, EE::Types, EE::Types::PermissionTypes, EE::Types::PermissionTypes::Project, Types::PermissionTypes::Project, Gitlab::Graphql::MarkdownField::Resolver, Types::BaseScalar, Types::TimeType, Types::RootStorageStatisticsType, Resolvers, Resolvers::BaseResolver, Resolvers::NamespaceProjectsResolver, Types::NamespaceType, Types::PermissionTypes::Group, EE::Types::GroupType, Types::PermissionTypes::Epic, Gitlab::View, Gitlab::View::Presenter, Gitlab::Routing, Gitlab::View::Presenter::Base, Gitlab::View::Presenter::CannotOverrideMethodError, Gitlab::View::Presenter::Delegated, EE::ProjectsHelper, ProjectsHelper, EE::ApplicationSettingsHelper, ApplicationSettingsHelper, API, API::Helpers::Pagination, API::Helpers::PaginationStrategies, EE::API, EE::API::Helpers, API::Helpers, API::Helpers::RelatedResourcesHelpers, EE::GitlabRoutingHelper, GitlabRoutingHelper, EntityDateHelper, EpicPresenter, Types::Notes, Types::BaseInterface, Types::PermissionTypes::Note, UserPresenter, Types::PermissionTypes::User, TodoPresenter, Types::BaseEnum, Types::TodoActionEnum, EE::Types::TodoTargetEnum, Types::TodoTargetEnum, Types::TodoStateEnum, Types::TodoType, Resolvers::TodoResolver, SnippetPresenter, Types::PermissionTypes::Snippet, Types::VisibilityLevelsEnum, Types::SnippetType, Resolvers::Users, ResolvesSnippets, Types::Snippets, Types::Snippets::VisibilityScopesEnum, Types::Snippets::TypeEnum, Resolvers::Users::SnippetsResolver, Types::UserType, Types::Notes::DiscussionType, Types::DiffRefsType, Types::Notes::PositionTypeEnum, Types::Notes::DiffPositionType, Types::Notes::NoteType, EE::Types::Notes, EE::Types::Notes::NoteableType, Types::Notes::NoteableType, Types::EpicStateEnum, Types::EpicSortEnum, Resolvers::EpicResolver, Types::LabelType, EE::Types::PermissionTypes::Issue, Types::PermissionTypes::Issue, IssuePresenter, Types::IssuableStateEnum, Types::IssueStateEnum, Types::MilestoneType, Types::TaskCompletionStatus, EE::Types::IssueType, Types::DesignManagement, DesignManagement, DesignManagement::Action, Types::DesignManagement::DesignVersionEventEnum, Types::DesignManagement::DesignFields, Types::DesignManagement::VersionType, Resolvers::DesignManagement, Resolvers::DesignManagement::VersionResolver, Types::DesignManagement::DesignType, Resolvers::DesignManagement::DesignResolver, Types::DesignManagement::DesignCollectionType, Types::IssueType, EpicIssuePresenter, Types::EpicIssueType, Resolvers::EpicIssuesResolver, Types::EpicDescendantCountType, Types::EpicType, Types::TimelogType, Resolvers::TimelogResolver, Types::GroupType, Types::ProjectStatisticsType, Types::Tree, CommitPresenter, Types::Ci, Types::PermissionTypes::Ci, Types::PermissionTypes::Ci::Pipeline, Ci, Gitlab::Ci, Gitlab::Ci::Model, HasStatus, Importable, Gitlab::OptimisticLocking, AtomicInternalId, EnumWithNil, HasRef, EE::ShaAttribute, ShaAttribute, UpdatedAtFilterable, Gitlab::Database::ShaAttribute, Gitlab::Database::BINARY_TYPE, EE::Ci, EE::Ci::PipelineEnums, Ci::PipelineEnums, EE::Ci::Pipeline, EE::UsageStatistics, Ci::Pipeline, Types::Ci::PipelineStatusEnum, Types::Ci::DetailedStatusType, Types::Ci::PipelineType, ResolvesPipelines, Resolvers::CommitPipelinesResolver, Types::CommitType, Resolvers::LastCommitResolver, Types::Tree::TypeEnum, Types::Tree::EntryType, TreeEntryPresenter, Types::Tree::TreeEntryType, Types::Tree::SubmoduleType, BlobPresenter, Types::Tree::BlobType, Types::Tree::TreeType, Resolvers::TreeResolver, Types::RepositoryType, MarkupHelper, EE::TreeHelper, TreeHelper, ChecksCollaboration, VisibleApprovable, EE::MergeRequestPresenter, MergeRequestPresenter, Types::PermissionTypes::MergeRequest, Types::MergeRequestStateEnum, Resolvers::MergeRequestPipelinesResolver, Types::MergeRequestType, Resolvers::MergeRequestsResolver, Types::SortEnum, Types::IssuableSortEnum, EE::Types::IssueSortEnum, Types::IssueSortEnum, Resolvers::IssuesResolver, Types::EnvironmentType, Resolvers::EnvironmentsResolver, Resolvers::ProjectPipelinesResolver, Types::ErrorTracking, SentryDetailedErrorPresenter, Types::ErrorTracking::SentryErrorStatusEnum, Types::ErrorTracking::SentryErrorFrequencyType, Types::ErrorTracking::SentryDetailedErrorType, Resolvers::ErrorTracking, Resolvers::ErrorTracking::SentryDetailedErrorResolver, Types::GrafanaIntegrationType, Resolvers::Projects, Resolvers::Projects::GrafanaIntegrationResolver, Resolvers::Projects::SnippetsResolver, EE::Types::ProjectType, Types::ProjectType, Resolvers::FullPathResolver, Resolvers::ProjectResolver, Resolvers::GroupResolver, Resolvers::NamespaceResolver, Types::MetadataType, Resolvers::MetadataResolver, Resolvers::SnippetsResolver, Resolvers::EchoResolver, Types::QueryType, Gitlab::Graphql::MountMutation, Mutations, Mutations::AwardEmojis, Gitlab::Graphql::Authorize::AuthorizeResource, Gitlab::Graphql::CopyFieldDescription, Mutations::BaseMutation, Types::AwardEmojis, AwardEmojiPresenter, Types::AwardEmojis::AwardEmojiType, Mutations::AwardEmojis::Base, Mutations::AwardEmojis::Add, Mutations::AwardEmojis::Remove, Mutations::AwardEmojis::Toggle, Mutations::Issues, Mutations::ResolvesProject, Mutations::Issues::Base, Mutations::Issues::SetConfidential, Mutations::Issues::SetDueDate, Mutations::MergeRequests, Mutations::MergeRequests::Base, Types::MutationOperationModeEnum, Mutations::MergeRequests::SetLabels, Mutations::MergeRequests::SetLocked, Mutations::MergeRequests::SetMilestone, Mutations::MergeRequests::SetSubscription, Mutations::MergeRequests::SetWip, Mutations::MergeRequests::SetAssignees, Mutations::Notes, Mutations::Notes::Create, Mutations::Notes::Base, Mutations::Notes::Create::Base, Mutations::Notes::Create::Note, Types::BaseInputObject, Types::DiffPathsInputType, Types::Notes::DiffPositionBaseInputType, Types::Notes::DiffPositionInputType, Mutations::Notes::Create::DiffNote, Types::Notes::DiffImagePositionInputType, Mutations::Notes::Create::ImageDiffNote, Mutations::Notes::Update, Mutations::Notes::Destroy, Mutations::Todos, Mutations::Todos::Base, Mutations::Todos::MarkDone, Mutations::Todos::Restore, Mutations::Todos::MarkAllDone, Mutations::Snippets, Mutations::Snippets::Base, Mutations::Snippets::Destroy, Mutations::Snippets::Update, Mutations::Snippets::Create, Mutations::Snippets::MarkAsSpam, EE::Types::MutationType, Mutations::DesignManagement, Mutations::DesignManagement::Base, Mutations::DesignManagement::Upload, Gitlab::Graphql::Errors, Mutations::DesignManagement::Delete, Mutations::Issues::SetWeight, Mutations::EpicTree, Types::EpicTree, Types::EpicTree::EpicTreeNodeInputType, Mutations::EpicTree::Reorder, Mutations::Epics, Mutations::ResolvesGroup, Mutations::Epics::Base, Mutations::SharedEpicArguments, Types::EpicStateEventEnum, Mutations::Epics::Update, Mutations::Epics::Create, Mutations::Epics::SetSubscription, Types::MutationType, GitlabSchema, Gitlab::Graphql::Authorize::Instrumentation, Gitlab::Graphql::Present::Instrumentation, Gitlab::Graphql::CallsGitaly::Instrumentation, Gitlab::Graphql::Connections::Keyset, Gitlab::Graphql::Connections::Keyset::Connection, Gitlab::Graphql::FilterableArray, Gitlab::Graphql::Connections::FilterableArrayConnection, Gitlab::Graphql::ExternallyPaginatedArray, Gitlab::Graphql::Connections::ExternallyPaginatedArrayConnection, Gitlab::Graphql::Authorize::AuthorizeFieldService, Gitlab::HealthChecks, Gitlab::HealthChecks::BaseAbstractCheck, Gitlab::HealthChecks::SimpleAbstractCheck, Gitlab::HealthChecks::MasterCheck, Gitlab::HTTPConnectionAdapter, Gitlab::Jira, Gitlab::Jira::Middleware, Gitlab::Database::LoadBalancing, EE::LfsRequest, LfsRequest, Gitlab::Octokit, Gitlab::Octokit::Middleware, Gitlab::PerformanceBar, Gitlab::PerformanceBar::RedisAdapterWhenPeekEnabled, Gitlab::PerformanceBar::WithTopLevelWarnings, Peek::Views::Host, Peek::Views::DetailedView, Peek::Views::ActiveRecord, Peek::Views::Gitaly, Peek::Views::RedisDetailed, Peek::Views::Rugged, Peek::Views::Tracing, Gitlab::QueryLimiting, Gitlab::QueryLimiting::ActiveSupportSubscriber, Gitlab::QueryLimiting::Transaction, Gitlab::QueryLimiting::Middleware, EE::Gitlab::Rack, EE::Gitlab::Throttle, EE::Gitlab::Rack::Attack, EE::Gitlab::Rack::Attack::Request, Gitlab::Middleware::RequestContext, Gitlab::RequestProfiler, Gitlab::RequestProfiler::Middleware, EE::Gitlab::Patch, EE::Gitlab::Patch::DrawRoute, Gitlab::Patch::DrawRoute, Gitlab::ErrorTracking, Gitlab::Popen, Gitlab::Sherlock::Collection, Gitlab::Sherlock, Gitlab::SidekiqMiddleware, Gitlab::SidekiqMiddleware::Monitor, Gitlab::SidekiqMiddleware::Metrics, Gitlab::SidekiqMiddleware::ServerMetrics, Gitlab::SidekiqMiddleware::ArgumentsLogger, Gitlab::SidekiqMiddleware::RequestStoreMiddleware, Gitlab::SidekiqMiddleware::BatchLoader, Gitlab::SidekiqMiddleware::InstrumentationLogger, Gitlab::SidekiqStatus, Gitlab::SidekiqStatus::ServerMiddleware, Gitlab::SidekiqStatus::ClientMiddleware, Gitlab::SidekiqMiddleware::ClientMetrics, WorkerAttributes, ApplicationWorker, CronjobQueue, StuckCiJobsWorker, PipelineScheduleWorker, ExpireBuildArtifactsWorker, RepositoryCheck, EachShardWorker, ExclusiveLeaseGuard, RepositoryCheck::DispatchWorker, Ci::ArchiveTracesCronWorker, AdminEmailWorker, RepositoryArchiveCacheWorker, PagesDomainVerificationCronWorker, Gitlab::ExclusiveLeaseHelpers, ScheduleMigrateExternalDiffsWorker, PersonalAccessTokens, PersonalAccessTokens::ExpiringWorker, ImportExportProjectCleanupWorker, RequestsProfilesWorker, RemoveExpiredMembersWorker, RemoveExpiredGroupLinksWorker, PruneOldEventsWorker, TrendingProjectsWorker, RemoveUnreferencedLfsObjectsWorker, StuckImportJobsWorker, GitlabUsagePingWorker, StuckMergeJobsWorker, PagesDomainRemovalCronWorker, PagesDomainSslRenewalCronWorker, IssueDueSchedulerWorker, PruneWebHookLogsWorker, Namespaces, Namespaces::PruneAggregationSchedulesWorker, ContainerExpirationPolicyWorker, AdjournedGroupDeletionWorker, ClearSharedRunnersMinutesWorker, AdjournedProjectsDeletionCronWorker, Geo::Scheduler, Geo::Scheduler::Secondary, GeoQueue, Gitlab::Geo::LogHelpers, GeoBackoffDelay, Geo::Scheduler::SchedulerWorker, Geo::Scheduler::Secondary::SchedulerWorker, Geo::FileDownloadDispatchWorker, Geo::MetricsUpdateWorker, Geo::MigratedLocalFilesCleanUpWorker, Geo::PruneEventLogWorker, Geo::Scheduler::PerShardSchedulerWorker, Geo::Scheduler::Secondary::PerShardSchedulerWorker, Geo::RepositorySyncWorker, Geo::RepositoryVerification, Geo::RepositoryVerification::Primary, Geo::Scheduler::Primary, Geo::Scheduler::Primary::PerShardSchedulerWorker, Geo::RepositoryVerification::Primary::BatchWorker, Geo::RepositoryVerification::Secondary, Geo::RepositoryVerification::Secondary::SchedulerWorker, Geo::ContainerRepositorySyncDispatchWorker, HistoricalDataWorker, ImportSoftwareLicensesWorker, LdapAllGroupsSyncWorker, LdapSyncWorker, PseudonymizerWorker, UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker, Gitlab::SidekiqVersioning, Gitlab::SidekiqVersioning::Manager, Gitlab::SidekiqConfig::CliMethods, Gitlab::SidekiqConfig, Gitlab::Mirror, UpdateAllMirrorsWorker, Gitlab::Geo::CronManager, Geo::SidekiqCronConfigWorker, Gitlab::SidekiqSignals, Gitlab::Patch::SprocketsBaseFileDigestKey, Gitlab::Middleware::Static, Gitlab::Webpack, Gitlab::Webpack::DevServerMiddleware, and Gitlab::Middleware::Multipart.
Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload Gitlab::Patch, for example,
the expected changes won't be reflected in that stale Module object.
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
Please, check the "Autoloading and Reloading Constants" guide for solutions.
This only affects development because we don't do autoloading and reloading in CI and production