Commit 88874777 authored by Yorick Peterse's avatar Yorick Peterse Committed by Yorick Peterse

Use X_if_ee injection methods for left-over lines

In MR https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14863 we
changed various prepend/include/extend lines to use the new X_if_ee
methods for injecting EE modules. Unfortunately, we forgot to take care
of a variety of lines due to the use of inaccurate patterns to find
these lines.

This commit takes care of moving over the remaining lines, except for
any prepend lines in the ee/ directory as the changes are not needed
there (since this directory is only available in EE).
parent 9c1ff791
......@@ -13,7 +13,7 @@
class LicenseTemplateFinder
include Gitlab::Utils::StrongMemoize
prepend ::EE::LicenseTemplateFinder # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::LicenseTemplateFinder') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :project, :params
......
......@@ -24,7 +24,7 @@
class ProjectsFinder < UnionFinder
include CustomAttributesFilter
prepend ::EE::ProjectsFinder # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::ProjectsFinder') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_accessor :params
attr_reader :current_user, :project_ids_relation
......
......@@ -3,7 +3,7 @@
class TemplateFinder
include Gitlab::Utils::StrongMemoize
prepend ::EE::TemplateFinder # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::TemplateFinder') # rubocop: disable Cop/InjectEnterpriseEditionModule
VENDORED_TEMPLATES = HashWithIndifferentAccess.new(
dockerfiles: ::Gitlab::Template::DockerfileTemplate,
......
# frozen_string_literal: true
module EnvironmentsHelper
prepend ::EE::EnvironmentsHelper # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::EnvironmentsHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
def environments_list_data
{
......
# frozen_string_literal: true
module FormHelper
prepend ::EE::FormHelper # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::FormHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
def form_errors(model, type: 'form')
return unless model.errors.any?
......
# frozen_string_literal: true
module ProjectsHelper
prepend ::EE::ProjectsHelper # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::ProjectsHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
def link_to_project(project)
link_to namespace_project_path(namespace_id: project.namespace, id: project), title: h(project.name) do
......
# frozen_string_literal: true
module SortingHelper
prepend ::EE::SortingHelper # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::SortingHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
def sort_options_hash
{
......
......@@ -7,7 +7,7 @@ class CommitStatus < ApplicationRecord
include Presentable
include EnumWithNil
prepend ::EE::CommitStatus # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::CommitStatus') # rubocop: disable Cop/InjectEnterpriseEditionModule
self.table_name = 'ci_builds'
......
......@@ -6,7 +6,7 @@ module PrometheusAdapter
included do
include ReactiveCaching
# We can't prepend outside of this model due to the use of `included`, so this must stay here.
prepend EE::PrometheusAdapter # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::PrometheusAdapter') # rubocop: disable Cop/InjectEnterpriseEditionModule
self.reactive_cache_lease_timeout = 30.seconds
self.reactive_cache_refresh_interval = 30.seconds
......
......@@ -5,7 +5,7 @@
# A note of this type can be resolvable.
class DiscussionNote < Note
# This prepend must stay here because the `validates` below depends on it.
prepend EE::DiscussionNote # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::DiscussionNote') # rubocop: disable Cop/InjectEnterpriseEditionModule
# Names of all implementers of `Noteable` that support discussions.
def self.noteable_types
......
......@@ -2,7 +2,7 @@
# Global Milestones are milestones that can be shared across multiple projects
class GlobalMilestone
include Milestoneish
include ::EE::GlobalMilestone # rubocop: disable Cop/InjectEnterpriseEditionModule
include_if_ee('::EE::GlobalMilestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
STATE_COUNT_HASH = { opened: 0, closed: 0, all: 0 }.freeze
......
# frozen_string_literal: true
# Group Milestones are milestones that can be shared among many projects within the same group
class GroupMilestone < GlobalMilestone
include ::EE::GroupMilestone # rubocop: disable Cop/InjectEnterpriseEditionModule
include_if_ee('::EE::GroupMilestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :group, :milestones
def self.build_collection(group, projects, params)
......
......@@ -3,7 +3,7 @@
class List < ApplicationRecord
include Importable
prepend ::EE::List # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::List') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :board
belongs_to :label
......
# frozen_string_literal: true
class MembersPreloader
prepend EE::MembersPreloader # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::MembersPreloader') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :members
......
......@@ -23,7 +23,7 @@ class MergeRequest < ApplicationRecord
SORTING_PREFERENCE_FIELD = :merge_requests_sort
prepend ::EE::MergeRequest # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::MergeRequest') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :target_project, class_name: "Project"
belongs_to :source_project, class_name: "Project"
......
......@@ -18,7 +18,7 @@ class Milestone < ApplicationRecord
include Milestoneish
include Gitlab::SQL::Pattern
prepend ::EE::Milestone # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Milestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description
......
......@@ -2,7 +2,7 @@
class ProjectAuthorization < ApplicationRecord
include FromUnion
prepend ::EE::ProjectAuthorization # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::ProjectAuthorization') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :user
belongs_to :project
......
......@@ -3,7 +3,7 @@
require 'carrierwave/orm/activerecord'
class ProjectImportData < ApplicationRecord
prepend ::EE::ProjectImportData # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::ProjectImportData') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :project, inverse_of: :import_data
attr_encrypted :credentials,
......
......@@ -2,7 +2,7 @@
module ChatMessage
class MergeMessage < BaseMessage
prepend ::EE::ChatMessage::MergeMessage # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::ChatMessage::MergeMessage') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :merge_request_iid
attr_reader :source_branch
......
......@@ -18,7 +18,7 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
presents :build
prepend ::EE::CommitStatusPresenter # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::CommitStatusPresenter') # rubocop: disable Cop/InjectEnterpriseEditionModule
def self.callout_failure_messages
CALLOUT_FAILURE_MESSAGES
......
# frozen_string_literal: true
class BuildDetailsEntity < JobEntity
prepend ::EE::BuildDetailEntity # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::BuildDetailEntity') # rubocop: disable Cop/InjectEnterpriseEditionModule
expose :coverage, :erased_at, :duration
expose :tag_list, as: :tags
......
......@@ -2,7 +2,7 @@
class IssueEntity < IssuableEntity
include TimeTrackableEntity
prepend ::EE::IssueEntity # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::IssueEntity') # rubocop: disable Cop/InjectEnterpriseEditionModule
expose :state
expose :milestone_id
......
# frozen_string_literal: true
class ProjectMirrorEntity < Grape::Entity
prepend ::EE::ProjectMirrorEntity # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::ProjectMirrorEntity') # rubocop: disable Cop/InjectEnterpriseEditionModule
expose :id
......
......@@ -137,7 +137,7 @@ module ObjectStorage
included do |base|
base.include(ObjectStorage)
include ::EE::ObjectStorage::Concern # rubocop: disable Cop/InjectEnterpriseEditionModule
include_if_ee('::EE::ObjectStorage::Concern') # rubocop: disable Cop/InjectEnterpriseEditionModule
after :migrate, :delete_migrated_file
end
......
......@@ -2,7 +2,7 @@
module RepositoryCheck
class BatchWorker
prepend ::EE::RepositoryCheck::BatchWorker # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::RepositoryCheck::BatchWorker') # rubocop: disable Cop/InjectEnterpriseEditionModule
include ApplicationWorker
include RepositoryCheckQueue
......
......@@ -5,7 +5,7 @@ module RepositoryCheck
include ApplicationWorker
include RepositoryCheckQueue
prepend ::EE::RepositoryCheck::SingleRepositoryWorker # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::RepositoryCheck::SingleRepositoryWorker') # rubocop: disable Cop/InjectEnterpriseEditionModule
def perform(project_id)
project = Project.find(project_id)
......
......@@ -41,7 +41,7 @@ module API
# Helper Methods for Grape Endpoint
module HelperMethods
prepend EE::API::APIGuard::HelperMethods # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::APIGuard::HelperMethods') # rubocop: disable Cop/InjectEnterpriseEditionModule
include Gitlab::Auth::UserAuthFinders
def find_current_user!
......
......@@ -5,7 +5,7 @@ module API
include BoardsResponses
include PaginationParams
prepend EE::API::BoardsResponses # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::BoardsResponses') # rubocop: disable Cop/InjectEnterpriseEditionModule
before { authenticate! }
......
......@@ -5,7 +5,7 @@ module API
include BoardsResponses
include PaginationParams
prepend EE::API::BoardsResponses # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::BoardsResponses') # rubocop: disable Cop/InjectEnterpriseEditionModule
before do
authenticate!
......
......@@ -16,7 +16,7 @@ module API
end
end
prepend EE::API::GroupClusters # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::GroupClusters') # rubocop: disable Cop/InjectEnterpriseEditionModule
params do
requires :id, type: String, desc: 'The ID of the group'
......
......@@ -3,7 +3,7 @@
module API
module Helpers
module ProjectSnapshotsHelpers
prepend ::EE::API::Helpers::ProjectSnapshotsHelpers # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::API::Helpers::ProjectSnapshotsHelpers') # rubocop: disable Cop/InjectEnterpriseEditionModule
def authorize_read_git_snapshot!
authenticated_with_full_private_access!
......
......@@ -3,7 +3,7 @@
module API
module Helpers
module Runner
prepend EE::API::Helpers::Runner # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::Helpers::Runner') # rubocop: disable Cop/InjectEnterpriseEditionModule
JOB_TOKEN_HEADER = 'HTTP_JOB_TOKEN'.freeze
JOB_TOKEN_PARAM = :token
......
......@@ -11,7 +11,7 @@ module API
end
end
prepend EE::API::JobArtifacts # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::JobArtifacts') # rubocop: disable Cop/InjectEnterpriseEditionModule
params do
requires :id, type: String, desc: 'The ID of a project'
......
......@@ -33,7 +33,7 @@ module API
]
end
prepend EE::API::MergeRequests # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::MergeRequests') # rubocop: disable Cop/InjectEnterpriseEditionModule
helpers do
# rubocop: disable CodeReuse/ActiveRecord
......
......@@ -17,7 +17,7 @@ module API
end
end
prepend EE::API::Namespaces # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::Namespaces') # rubocop: disable Cop/InjectEnterpriseEditionModule
resource :namespaces do
desc 'Get a namespaces list' do
......
......@@ -16,7 +16,7 @@ module API
end
end
prepend EE::API::ProjectClusters # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::API::ProjectClusters') # rubocop: disable Cop/InjectEnterpriseEditionModule
params do
requires :id, type: String, desc: 'The ID of the project'
......
......@@ -4,7 +4,7 @@ module Banzai
module Filter
# The actual filter is implemented in the EE mixin
class EpicReferenceFilter < IssuableReferenceFilter
prepend EE::Banzai::Filter::EpicReferenceFilter # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Banzai::Filter::EpicReferenceFilter') # rubocop: disable Cop/InjectEnterpriseEditionModule
self.reference_type = :epic
......
......@@ -9,7 +9,7 @@ module Banzai
# so we can avoid N+1 queries problem
class IssuableExtractor
prepend EE::Banzai::IssuableExtractor # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Banzai::IssuableExtractor') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :context
......
......@@ -3,7 +3,7 @@
module Banzai
module Pipeline
class GfmPipeline < BasePipeline
prepend EE::Banzai::Pipeline::GfmPipeline # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Banzai::Pipeline::GfmPipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
# These filters transform GitLab Flavored Markdown (GFM) to HTML.
# The nodes and marks referenced in app/assets/javascripts/behaviors/markdown/editor_extensions.js
......
......@@ -3,7 +3,7 @@
module Banzai
module Pipeline
class PostProcessPipeline < BasePipeline
prepend EE::Banzai::Pipeline::PostProcessPipeline # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Banzai::Pipeline::PostProcessPipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
def self.filters
@filters ||= FilterArray[
......
......@@ -3,7 +3,7 @@
module Banzai
module Pipeline
class SingleLinePipeline < GfmPipeline
prepend EE::Banzai::Pipeline::SingleLinePipeline # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Banzai::Pipeline::SingleLinePipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
def self.filters
@filters ||= FilterArray[
......
......@@ -4,7 +4,7 @@ module Banzai
module ReferenceParser
# The actual parser is implemented in the EE mixin
class EpicParser < IssuableParser
prepend ::EE::Banzai::ReferenceParser::EpicParser # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Banzai::ReferenceParser::EpicParser') # rubocop: disable Cop/InjectEnterpriseEditionModule
self.reference_type = :epic
......
......@@ -4,7 +4,7 @@ require 'flipper/adapters/active_record'
require 'flipper/adapters/active_support_cache_store'
class Feature
prepend EE::Feature # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Feature') # rubocop: disable Cop/InjectEnterpriseEditionModule
# Classes to override flipper table names
class FlipperFeature < Flipper::Adapters::ActiveRecord::Feature
......
......@@ -26,7 +26,7 @@ module Gitlab
DEFAULT_SCOPES = [:api].freeze
class << self
prepend EE::Gitlab::Auth # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Auth') # rubocop: disable Cop/InjectEnterpriseEditionModule
def omniauth_enabled?
Gitlab.config.omniauth.enabled
......
......@@ -8,7 +8,7 @@ module Gitlab
module Auth
module LDAP
class Access
prepend ::EE::Gitlab::Auth::LDAP::Access # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::LDAP::Access') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :provider, :user, :ldap_identity
......
......@@ -4,7 +4,7 @@ module Gitlab
module Auth
module LDAP
class Adapter
prepend ::EE::Gitlab::Auth::LDAP::Adapter # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::LDAP::Adapter') # rubocop: disable Cop/InjectEnterpriseEditionModule
SEARCH_RETRY_FACTOR = [1, 1, 2, 3].freeze
MAX_SEARCH_RETRIES = Rails.env.test? ? 1 : SEARCH_RETRY_FACTOR.size.freeze
......
......@@ -5,7 +5,7 @@ module Gitlab
module Auth
module LDAP
class Config
prepend ::EE::Gitlab::Auth::LDAP::Config # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::LDAP::Config') # rubocop: disable Cop/InjectEnterpriseEditionModule
NET_LDAP_ENCRYPTION_METHOD = {
simple_tls: :simple_tls,
......
......@@ -4,7 +4,7 @@ module Gitlab
module Auth
module LDAP
class Person
prepend ::EE::Gitlab::Auth::LDAP::Person # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::LDAP::Person') # rubocop: disable Cop/InjectEnterpriseEditionModule
# Active Directory-specific LDAP filter that checks if bit 2 of the
# userAccountControl attribute is set.
......
......@@ -11,7 +11,7 @@ module Gitlab
module LDAP
class User < Gitlab::Auth::OAuth::User
extend ::Gitlab::Utils::Override
prepend ::EE::Gitlab::Auth::LDAP::User # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::LDAP::User') # rubocop: disable Cop/InjectEnterpriseEditionModule
class << self
# rubocop: disable CodeReuse/ActiveRecord
......
......@@ -6,7 +6,7 @@ module Gitlab
module Auth
module OAuth
class AuthHash
prepend ::EE::Gitlab::Auth::OAuth::AuthHash # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::OAuth::AuthHash') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :auth_hash
def initialize(auth_hash)
......
......@@ -9,7 +9,7 @@ module Gitlab
module Auth
module OAuth
class User
prepend ::EE::Gitlab::Auth::OAuth::User # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::OAuth::User') # rubocop: disable Cop/InjectEnterpriseEditionModule
SignupDisabledError = Class.new(StandardError)
SigninDisabledForProviderError = Class.new(StandardError)
......
......@@ -3,7 +3,7 @@
module Gitlab
module Auth
Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
prepend ::EE::Gitlab::Auth::Result # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::Result') # rubocop: disable Cop/InjectEnterpriseEditionModule
def ci?(for_project)
type == :ci &&
......
......@@ -4,7 +4,7 @@ module Gitlab
module Auth
module Saml
class Config
prepend ::EE::Gitlab::Auth::Saml::Config # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::Saml::Config') # rubocop: disable Cop/InjectEnterpriseEditionModule
class << self
def options
......
......@@ -9,7 +9,7 @@ module Gitlab
module Auth
module Saml
class User < Gitlab::Auth::OAuth::User
prepend ::EE::Gitlab::Auth::Saml::User # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::Saml::User') # rubocop: disable Cop/InjectEnterpriseEditionModule
extend ::Gitlab::Utils::Override
......
......@@ -18,7 +18,7 @@ module Gitlab
end
module UserAuthFinders
prepend ::EE::Gitlab::Auth::UserAuthFinders # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Auth::UserAuthFinders') # rubocop: disable Cop/InjectEnterpriseEditionModule
include Gitlab::Utils::StrongMemoize
......
......@@ -3,7 +3,7 @@
module Gitlab
module Checks
class BaseChecker
prepend EE::Gitlab::Checks::BaseChecker # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Checks::BaseChecker') # rubocop: disable Cop/InjectEnterpriseEditionModule
include Gitlab::Utils::StrongMemoize
attr_reader :change_access
......
......@@ -3,7 +3,7 @@
module Gitlab
module Checks
class ChangeAccess
prepend EE::Gitlab::Checks::ChangeAccess # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Checks::ChangeAccess') # rubocop: disable Cop/InjectEnterpriseEditionModule
ATTRIBUTES = %i[user_access project skip_authorization
skip_lfs_integrity_check protocol oldrev newrev ref
......
......@@ -4,7 +4,7 @@ module Gitlab
module Checks
class DiffCheck < BaseChecker
include Gitlab::Utils::StrongMemoize
prepend EE::Gitlab::Checks::DiffCheck # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Checks::DiffCheck') # rubocop: disable Cop/InjectEnterpriseEditionModule
LOG_MESSAGES = {
validate_file_paths: "Validating diffs' file paths...",
......
......@@ -3,7 +3,7 @@
module Gitlab
module Ci
module Parsers
prepend ::EE::Gitlab::Ci::Parsers # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Ci::Parsers') # rubocop: disable Cop/InjectEnterpriseEditionModule
ParserNotFoundError = Class.new(ParserError)
......
......@@ -21,7 +21,7 @@ module Gitlab
private_constant :REASONS
prepend ::EE::Gitlab::Ci::Status::Build::Failed # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Ci::Status::Build::Failed') # rubocop: disable Cop/InjectEnterpriseEditionModule
def status_tooltip
base_message
......
......@@ -3,7 +3,7 @@
module Gitlab
module Email
module Handler
prepend ::EE::Gitlab::Email::Handler # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::Email::Handler') # rubocop: disable Cop/InjectEnterpriseEditionModule
def self.handlers
@handlers ||= load_handlers
......
......@@ -3,7 +3,7 @@
module Gitlab
module EtagCaching
class Router
prepend EE::Gitlab::EtagCaching::Router # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::EtagCaching::Router') # rubocop: disable Cop/InjectEnterpriseEditionModule
Route = Struct.new(:regexp, :name)
# We enable an ETag for every request matching the regex.
......
......@@ -2,7 +2,7 @@
module Gitlab
class GitAccessWiki < GitAccess
prepend EE::Gitlab::GitAccessWiki # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::GitAccessWiki') # rubocop: disable Cop/InjectEnterpriseEditionModule
ERROR_MESSAGES = {
read_only: "You can't push code to a read-only GitLab instance.",
......
......@@ -5,7 +5,7 @@ module Gitlab
# The ParallelImporter schedules the importing of a GitHub project using
# Sidekiq.
class ParallelImporter
prepend ::EE::Gitlab::GithubImport::ParallelImporter # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::GithubImport::ParallelImporter') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :project
......
......@@ -3,7 +3,7 @@
module Gitlab
module ImportExport
class RelationFactory
prepend ::EE::Gitlab::ImportExport::RelationFactory # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::ImportExport::RelationFactory') # rubocop: disable Cop/InjectEnterpriseEditionModule
OVERRIDES = { snippets: :project_snippets,
ci_pipelines: 'Ci::Pipeline',
......
......@@ -25,7 +25,7 @@ module Gitlab
].freeze
class << self
prepend EE::Gitlab::ImportSources # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::ImportSources') # rubocop: disable Cop/InjectEnterpriseEditionModule
def options
Hash[import_table.map { |importer| [importer.title, importer.name] }]
......
......@@ -4,7 +4,7 @@ module Gitlab
module Middleware
class ReadOnly
class Controller
prepend EE::Gitlab::Middleware::ReadOnly::Controller # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Middleware::ReadOnly::Controller') # rubocop: disable Cop/InjectEnterpriseEditionModule
DISALLOWED_METHODS = %w(POST PATCH PUT DELETE).freeze
APPLICATION_JSON = 'application/json'.freeze
......
......@@ -2,7 +2,7 @@
module Gitlab
class OmniauthInitializer
prepend ::EE::Gitlab::OmniauthInitializer # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::OmniauthInitializer') # rubocop: disable Cop/InjectEnterpriseEditionModule
def initialize(devise_config)
@devise_config = devise_config
......
......@@ -5,7 +5,7 @@
module Gitlab
module Patch
module DrawRoute
prepend EE::Gitlab::Patch::DrawRoute # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Patch::DrawRoute') # rubocop: disable Cop/InjectEnterpriseEditionModule
RoutesNotFound = Class.new(StandardError)
......
......@@ -3,7 +3,7 @@
module Gitlab
module Prometheus
class MetricGroup
prepend EE::Gitlab::Prometheus::MetricGroup # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Prometheus::MetricGroup') # rubocop: disable Cop/InjectEnterpriseEditionModule
include ActiveModel::Model
attr_accessor :name, :priority, :metrics
......
......@@ -4,7 +4,7 @@ module Gitlab
module Prometheus
module Queries
module QueryAdditionalMetrics
prepend EE::Gitlab::Prometheus::Queries::QueryAdditionalMetrics # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Prometheus::Queries::QueryAdditionalMetrics') # rubocop: disable Cop/InjectEnterpriseEditionModule
def query_metrics(project, environment, query_context)
matched_metrics(project).map(&query_group(query_context))
......
......@@ -3,7 +3,7 @@
module Gitlab
module Search
class ParsedQuery
prepend EE::Gitlab::Search::ParsedQuery # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::Search::ParsedQuery') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :term, :filters
......
......@@ -4,7 +4,7 @@ module Gitlab
module SlashCommands
module Presenters
module IssueBase
prepend EE::Gitlab::SlashCommands::Presenters::IssueBase # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('EE::Gitlab::SlashCommands::Presenters::IssueBase') # rubocop: disable Cop/InjectEnterpriseEditionModule
def color(issuable)
issuable.open? ? '#38ae67' : '#d22852'
......
......@@ -2,7 +2,7 @@
module Gitlab
class TreeSummary
prepend ::EE::Gitlab::TreeSummary # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('::EE::Gitlab::TreeSummary') # rubocop: disable Cop/InjectEnterpriseEditionModule
include ::Gitlab::Utils::StrongMemoize
......
......@@ -4,7 +4,7 @@ module QA
module Page
module Admin
class Menu < Page::Base
prepend EE::Page::Admin::Menu # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('QA::EE::Page::Admin::Menu')
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :admin_sidebar
......
......@@ -109,4 +109,4 @@ module QA
end
end
QA::Page::Project::Issue::Show.prepend(QA::EE::Page::Project::Issue::Show)
QA::Page::Project::Issue::Show.prepend_if_ee('QA::EE::Page::Project::Issue::Show')
......@@ -40,4 +40,4 @@ module QA
end
end
QA::Page::Project::Menu.prepend(QA::EE::Page::Project::SubMenus::SecurityCompliance)
QA::Page::Project::Menu.prepend_if_ee('QA::EE::Page::Project::SubMenus::SecurityCompliance')
......@@ -5,7 +5,7 @@ module QA
module Project
class New < Page::Base
include Page::Component::Select2
prepend EE::Page::Project::New # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('QA::EE::Page::Project::New')
view 'app/views/projects/new.html.haml' do
element :project_create_from_template_tab
......
......@@ -54,4 +54,4 @@ module QA
end
end
QA::Page::Project::Operations::Kubernetes::Show.prepend(QA::EE::Page::Project::Operations::Kubernetes::Show)
QA::Page::Project::Operations::Kubernetes::Show.prepend_if_ee('QA::EE::Page::Project::Operations::Kubernetes::Show')
......@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class MirroringRepositories < Page::Base
prepend EE::Page::Project::Settings::MirroringRepositories # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('QA::EE::Page::Project::Settings::MirroringRepositories')
view 'app/views/projects/mirrors/_authentication_method.html.haml' do
element :authentication_method
......
......@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class ProtectedBranches < Page::Base
prepend EE::Page::Project::Settings::ProtectedBranches # rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee('QA::EE::Page::Project::Settings::ProtectedBranches')
view 'app/views/projects/protected_branches/shared/_dropdown.html.haml' do
element :protected_branch_select
......
......@@ -57,4 +57,4 @@ module QA
end
end
QA::Scenario::Test::Sanity::Selectors.prepend(QA::EE::Scenario::Test::Sanity::Selectors)
QA::Scenario::Test::Sanity::Selectors.prepend_if_ee('QA::EE::Scenario::Test::Sanity::Selectors')
......@@ -14,4 +14,4 @@ module DbCleaner
end
end
DbCleaner.prepend(EE::DbCleaner)
DbCleaner.prepend_if_ee('EE::DbCleaner')
......@@ -71,4 +71,4 @@ module LdapHelpers
end
end
LdapHelpers.include(EE::LdapHelpers)
LdapHelpers.include_if_ee('EE::LdapHelpers')
......@@ -7,4 +7,4 @@ module LicenseHelpers
end
end
LicenseHelpers.prepend(EE::LicenseHelpers)
LicenseHelpers.prepend_if_ee('EE::LicenseHelpers')
......@@ -212,4 +212,4 @@ module LoginHelpers
end
end
LoginHelpers.prepend(EE::LoginHelpers)
LoginHelpers.prepend_if_ee('EE::LoginHelpers')
......@@ -134,4 +134,4 @@ module MigrationsHelpers
end
end
MigrationsHelpers.prepend(EE::MigrationsHelpers)
MigrationsHelpers.prepend_if_ee('EE::MigrationsHelpers')
......@@ -146,4 +146,4 @@ end
require_relative '../../../ee/spec/support/helpers/ee/stub_configuration' if
Dir.exist?("#{__dir__}/../../../ee")
StubConfiguration.prepend(EE::StubConfiguration)
StubConfiguration.prepend_if_ee('EE::StubConfiguration')
......@@ -140,4 +140,4 @@ module StubGitlabCalls
end
end
StubGitlabCalls.prepend(EE::StubGitlabCalls)
StubGitlabCalls.prepend_if_ee('EE::StubGitlabCalls')
......@@ -79,4 +79,4 @@ end
require_relative '../../../ee/spec/support/helpers/ee/stub_object_storage' if
Dir.exist?("#{__dir__}/../../../ee")
StubObjectStorage.prepend(EE::StubObjectStorage)
StubObjectStorage.prepend_if_ee('EE::StubObjectStorage')
......@@ -422,5 +422,5 @@ end
require_relative '../../../ee/spec/support/helpers/ee/test_env'
::TestEnv.prepend(::EE::TestEnv)
::TestEnv.extend(::EE::TestEnv)
::TestEnv.prepend_if_ee('::EE::TestEnv')
::TestEnv.extend_if_ee('::EE::TestEnv')
......@@ -231,4 +231,4 @@ module RSpec::Matchers::DSL::Macros
end
end
MarkdownMatchers.prepend(EE::MarkdownMatchers)
MarkdownMatchers.prepend_if_ee('EE::MarkdownMatchers')
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