Skip to content
Snippets Groups Projects
Commit b7dfe2ae authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 25cb337c
No related branches found
No related tags found
No related merge requests found
Showing
with 53 additions and 2 deletions
Loading
Loading
@@ -439,3 +439,6 @@ module Issuable
respond_to?(:milestone_id)
end
end
Issuable.prepend_if_ee('EE::Issuable') # rubocop: disable Cop/InjectEnterpriseEditionModule
Issuable::ClassMethods.prepend_if_ee('EE::Issuable::ClassMethods')
Loading
Loading
@@ -172,3 +172,5 @@ module Mentionable
{}
end
end
Mentionable.prepend_if_ee('EE::Mentionable')
Loading
Loading
@@ -34,3 +34,5 @@ module Mentionable
end
end
end
Mentionable::ReferenceRegexes.prepend_if_ee('EE::Mentionable::ReferenceRegexes')
Loading
Loading
@@ -143,3 +143,6 @@ module Noteable
end
 
Noteable.extend(Noteable::ClassMethods)
Noteable::ClassMethods.prepend_if_ee('EE::Noteable::ClassMethods') # rubocop: disable Cop/InjectEnterpriseEditionModule
Noteable.prepend_if_ee('EE::Noteable')
Loading
Loading
@@ -25,7 +25,6 @@
# users = issue.participants
module Participable
extend ActiveSupport::Concern
class_methods do
# Adds a list of participant attributes. Attributes can either be symbols or
# Procs.
Loading
Loading
@@ -112,3 +111,5 @@ module Participable
end
end
end
Participable.prepend_if_ee('EE::Participable')
Loading
Loading
@@ -5,6 +5,8 @@ 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_if_ee('EE::PrometheusAdapter') # rubocop: disable Cop/InjectEnterpriseEditionModule
 
self.reactive_cache_lease_timeout = 30.seconds
self.reactive_cache_refresh_interval = 30.seconds
Loading
Loading
Loading
Loading
@@ -67,3 +67,9 @@ module ProtectedRef
@ref_matcher ||= RefMatcher.new(self.name)
end
end
# Prepending a module into a concern doesn't work very well for class methods,
# since these are defined in a ClassMethods constant. As such, we prepend the
# module directly into ProtectedRef::ClassMethods, instead of prepending it into
# ProtectedRef.
ProtectedRef::ClassMethods.prepend_if_ee('EE::ProtectedRef')
Loading
Loading
@@ -2,7 +2,6 @@
 
module ProtectedRefAccess
extend ActiveSupport::Concern
HUMAN_ACCESS_LEVELS = {
Gitlab::Access::MAINTAINER => "Maintainers",
Gitlab::Access::DEVELOPER => "Developers + Maintainers",
Loading
Loading
@@ -51,3 +50,13 @@ module ProtectedRefAccess
project.team.max_member_access(user.id) >= access_level
end
end
ProtectedRefAccess.include_if_ee('EE::ProtectedRefAccess::Scopes') # rubocop: disable Cop/InjectEnterpriseEditionModule
ProtectedRefAccess.prepend_if_ee('EE::ProtectedRefAccess') # rubocop: disable Cop/InjectEnterpriseEditionModule
# When using `prepend` (or `include` for that matter), the `ClassMethods`
# constants are not merged. This means that `class_methods` in
# `EE::ProtectedRefAccess` would be ignored.
#
# To work around this, we prepend the `ClassMethods` constant manually.
ProtectedRefAccess::ClassMethods.prepend_if_ee('EE::ProtectedRefAccess::ClassMethods')
Loading
Loading
@@ -47,3 +47,5 @@ module ShaAttribute
end
end
end
ShaAttribute::ClassMethods.prepend_if_ee('EE::ShaAttribute')
Loading
Loading
@@ -96,3 +96,5 @@ class ContainerRepository < ApplicationRecord
name: path.repository_name)
end
end
ContainerRepository.prepend_if_ee('EE::ContainerRepository')
Loading
Loading
@@ -173,3 +173,5 @@ class DiffNote < Note
noteable.respond_to?(:repository) ? noteable.repository : project.repository
end
end
DiffNote.prepend_if_ee('::EE::DiffNote')
Loading
Loading
@@ -4,6 +4,9 @@
#
# A note of this type can be resolvable.
class DiscussionNote < Note
# This prepend must stay here because the `validates` below depends on it.
prepend_if_ee('EE::DiscussionNote') # rubocop: disable Cop/InjectEnterpriseEditionModule
# Names of all implementers of `Noteable` that support discussions.
def self.noteable_types
%w(MergeRequest Issue Commit Snippet)
Loading
Loading
Loading
Loading
@@ -246,3 +246,5 @@ class Environment < ApplicationRecord
self.slug = Gitlab::Slug::Environment.new(name).generate
end
end
Environment.prepend_if_ee('EE::Environment')
Loading
Loading
@@ -15,3 +15,5 @@ class Epic < ApplicationRecord
'&amp;'
end
end
Epic.prepend_if_ee('EE::Epic')
Loading
Loading
@@ -409,3 +409,5 @@ class Event < ApplicationRecord
UserInteractedProject.track(self) if UserInteractedProject.available?
end
end
Event.prepend_if_ee('EE::Event')
Loading
Loading
@@ -2,6 +2,7 @@
# Global Milestones are milestones that can be shared across multiple projects
class GlobalMilestone
include Milestoneish
include_if_ee('::EE::GlobalMilestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
 
STATE_COUNT_HASH = { opened: 0, closed: 0, all: 0 }.freeze
 
Loading
Loading
Loading
Loading
@@ -465,3 +465,5 @@ class Group < Namespace
errors.add(:visibility_level, "#{visibility} is not allowed since there are sub-groups with higher visibility.")
end
end
Group.prepend_if_ee('EE::Group')
# frozen_string_literal: true
# Group Milestones are milestones that can be shared among many projects within the same group
class GroupMilestone < GlobalMilestone
include_if_ee('::EE::GroupMilestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :group, :milestones
 
def self.build_collection(group, projects, params)
Loading
Loading
Loading
Loading
@@ -19,3 +19,5 @@ class ProjectHook < WebHook
belongs_to :project
validates :project, presence: true
end
ProjectHook.prepend_if_ee('EE::ProjectHook')
Loading
Loading
@@ -47,3 +47,5 @@ class Identity < ApplicationRecord
user.user_synced_attributes_metadata&.destroy
end
end
Identity.prepend_if_ee('EE::Identity')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment