Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-28 15:09:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-28 15:09:44 +0300
commitc74b7b5e4345702a1d59c72d923c3580ef157a59 (patch)
tree0d6cc261341fa36babe44e497dc26153da611b7b /lib
parent0f59ad0c29c8679957c716317c842f606177f223 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/auth/auth_finders.rb4
-rw-r--r--lib/gitlab/auth/ldap/access.rb4
-rw-r--r--lib/gitlab/auth/ldap/adapter.rb4
-rw-r--r--lib/gitlab/auth/ldap/config.rb4
-rw-r--r--lib/gitlab/auth/ldap/person.rb4
-rw-r--r--lib/gitlab/auth/ldap/user.rb4
-rw-r--r--lib/gitlab/auth/o_auth/auth_hash.rb4
-rw-r--r--lib/gitlab/auth/o_auth/user.rb4
-rw-r--r--lib/gitlab/auth/result.rb4
-rw-r--r--lib/gitlab/auth/saml/config.rb4
-rw-r--r--lib/gitlab/auth/saml/user.rb4
-rw-r--r--lib/gitlab/checks/base_checker.rb3
-rw-r--r--lib/gitlab/checks/change_access.rb4
-rw-r--r--lib/gitlab/checks/diff_check.rb3
-rw-r--r--lib/gitlab/ci/parsers.rb4
-rw-r--r--lib/gitlab/diff/file.rb15
-rw-r--r--lib/gitlab/wiki_pages.rb3
17 files changed, 48 insertions, 28 deletions
diff --git a/lib/gitlab/auth/auth_finders.rb b/lib/gitlab/auth/auth_finders.rb
index f0ca6491bd0..07021758e6b 100644
--- a/lib/gitlab/auth/auth_finders.rb
+++ b/lib/gitlab/auth/auth_finders.rb
@@ -18,8 +18,6 @@ module Gitlab
end
module AuthFinders
- prepend_if_ee('::EE::Gitlab::Auth::AuthFinders') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
include Gitlab::Utils::StrongMemoize
include ActionController::HttpAuthentication::Basic
@@ -249,3 +247,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::AuthFinders.prepend_if_ee('::EE::Gitlab::Auth::AuthFinders')
diff --git a/lib/gitlab/auth/ldap/access.rb b/lib/gitlab/auth/ldap/access.rb
index 98eec0e4a7b..66d20ee2b59 100644
--- a/lib/gitlab/auth/ldap/access.rb
+++ b/lib/gitlab/auth/ldap/access.rb
@@ -8,8 +8,6 @@ module Gitlab
module Auth
module Ldap
class Access
- prepend_if_ee('::EE::Gitlab::Auth::Ldap::Access') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
attr_reader :provider, :user, :ldap_identity
def self.open(user, &block)
@@ -118,3 +116,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Ldap::Access.prepend_if_ee('::EE::Gitlab::Auth::Ldap::Access')
diff --git a/lib/gitlab/auth/ldap/adapter.rb b/lib/gitlab/auth/ldap/adapter.rb
index c5ec4e1981b..f64fcd822c6 100644
--- a/lib/gitlab/auth/ldap/adapter.rb
+++ b/lib/gitlab/auth/ldap/adapter.rb
@@ -4,8 +4,6 @@ module Gitlab
module Auth
module Ldap
class Adapter
- 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
@@ -142,3 +140,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Ldap::Adapter.prepend_if_ee('::EE::Gitlab::Auth::Ldap::Adapter')
diff --git a/lib/gitlab/auth/ldap/config.rb b/lib/gitlab/auth/ldap/config.rb
index b8874e18a0b..7677189eb9f 100644
--- a/lib/gitlab/auth/ldap/config.rb
+++ b/lib/gitlab/auth/ldap/config.rb
@@ -5,8 +5,6 @@ module Gitlab
module Auth
module Ldap
class Config
- prepend_if_ee('::EE::Gitlab::Auth::Ldap::Config') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
NET_LDAP_ENCRYPTION_METHOD = {
simple_tls: :simple_tls,
start_tls: :start_tls,
@@ -288,3 +286,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Ldap::Config.prepend_if_ee('::EE::Gitlab::Auth::Ldap::Config')
diff --git a/lib/gitlab/auth/ldap/person.rb b/lib/gitlab/auth/ldap/person.rb
index 430f94a9a28..e4a4900c37a 100644
--- a/lib/gitlab/auth/ldap/person.rb
+++ b/lib/gitlab/auth/ldap/person.rb
@@ -4,8 +4,6 @@ module Gitlab
module Auth
module Ldap
class Person
- 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.
# Source: http://ctogonewild.com/2009/09/03/bitmask-searches-in-ldap/
@@ -122,3 +120,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Ldap::Person.prepend_if_ee('::EE::Gitlab::Auth::Ldap::Person')
diff --git a/lib/gitlab/auth/ldap/user.rb b/lib/gitlab/auth/ldap/user.rb
index df14e5fc3dc..1405fb4ab95 100644
--- a/lib/gitlab/auth/ldap/user.rb
+++ b/lib/gitlab/auth/ldap/user.rb
@@ -11,8 +11,6 @@ module Gitlab
module Ldap
class User < Gitlab::Auth::OAuth::User
extend ::Gitlab::Utils::Override
- prepend_if_ee('::EE::Gitlab::Auth::Ldap::User') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
class << self
# rubocop: disable CodeReuse/ActiveRecord
def find_by_uid_and_provider(uid, provider)
@@ -64,3 +62,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Ldap::User.prepend_if_ee('::EE::Gitlab::Auth::Ldap::User')
diff --git a/lib/gitlab/auth/o_auth/auth_hash.rb b/lib/gitlab/auth/o_auth/auth_hash.rb
index b37a9225dd7..46ff6b2ccab 100644
--- a/lib/gitlab/auth/o_auth/auth_hash.rb
+++ b/lib/gitlab/auth/o_auth/auth_hash.rb
@@ -6,8 +6,6 @@ module Gitlab
module Auth
module OAuth
class AuthHash
- prepend_if_ee('::EE::Gitlab::Auth::OAuth::AuthHash') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
attr_reader :auth_hash
def initialize(auth_hash)
@auth_hash = auth_hash
@@ -93,3 +91,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::OAuth::AuthHash.prepend_if_ee('::EE::Gitlab::Auth::OAuth::AuthHash')
diff --git a/lib/gitlab/auth/o_auth/user.rb b/lib/gitlab/auth/o_auth/user.rb
index df595da1536..8a60d6ef482 100644
--- a/lib/gitlab/auth/o_auth/user.rb
+++ b/lib/gitlab/auth/o_auth/user.rb
@@ -9,8 +9,6 @@ module Gitlab
module Auth
module OAuth
class User
- prepend_if_ee('::EE::Gitlab::Auth::OAuth::User') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
SignupDisabledError = Class.new(StandardError)
SigninDisabledForProviderError = Class.new(StandardError)
@@ -275,3 +273,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::OAuth::User.prepend_if_ee('::EE::Gitlab::Auth::OAuth::User')
diff --git a/lib/gitlab/auth/result.rb b/lib/gitlab/auth/result.rb
index 0fe91f9f3c8..757a0e671c3 100644
--- a/lib/gitlab/auth/result.rb
+++ b/lib/gitlab/auth/result.rb
@@ -3,8 +3,6 @@
module Gitlab
module Auth
Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
- prepend_if_ee('::EE::Gitlab::Auth::Result') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
def ci?(for_project)
type == :ci &&
project &&
@@ -26,3 +24,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Result.prepend_if_ee('::EE::Gitlab::Auth::Result')
diff --git a/lib/gitlab/auth/saml/config.rb b/lib/gitlab/auth/saml/config.rb
index ed2f3f158c1..67a53fa3205 100644
--- a/lib/gitlab/auth/saml/config.rb
+++ b/lib/gitlab/auth/saml/config.rb
@@ -4,8 +4,6 @@ module Gitlab
module Auth
module Saml
class Config
- prepend_if_ee('::EE::Gitlab::Auth::Saml::Config') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
class << self
def options
Gitlab::Auth::OAuth::Provider.config_for('saml')
@@ -31,3 +29,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Saml::Config.prepend_if_ee('::EE::Gitlab::Auth::Saml::Config')
diff --git a/lib/gitlab/auth/saml/user.rb b/lib/gitlab/auth/saml/user.rb
index 1ba36ad95b4..37bc3f9bed0 100644
--- a/lib/gitlab/auth/saml/user.rb
+++ b/lib/gitlab/auth/saml/user.rb
@@ -9,8 +9,6 @@ module Gitlab
module Auth
module Saml
class User < Gitlab::Auth::OAuth::User
- prepend_if_ee('::EE::Gitlab::Auth::Saml::User') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
extend ::Gitlab::Utils::Override
def save
@@ -63,3 +61,5 @@ module Gitlab
end
end
end
+
+Gitlab::Auth::Saml::User.prepend_if_ee('::EE::Gitlab::Auth::Saml::User')
diff --git a/lib/gitlab/checks/base_checker.rb b/lib/gitlab/checks/base_checker.rb
index a14fa02c2a4..0045d8a4113 100644
--- a/lib/gitlab/checks/base_checker.rb
+++ b/lib/gitlab/checks/base_checker.rb
@@ -3,7 +3,6 @@
module Gitlab
module Checks
class BaseChecker
- prepend_if_ee('EE::Gitlab::Checks::BaseChecker') # rubocop: disable Cop/InjectEnterpriseEditionModule
include Gitlab::Utils::StrongMemoize
attr_reader :change_access
@@ -57,3 +56,5 @@ module Gitlab
end
end
end
+
+Gitlab::Checks::BaseChecker.prepend_if_ee('EE::Gitlab::Checks::BaseChecker')
diff --git a/lib/gitlab/checks/change_access.rb b/lib/gitlab/checks/change_access.rb
index 14a445fcb96..8bb5ac94e45 100644
--- a/lib/gitlab/checks/change_access.rb
+++ b/lib/gitlab/checks/change_access.rb
@@ -3,8 +3,6 @@
module Gitlab
module Checks
class ChangeAccess
- 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
branch_name tag_name logger commits].freeze
@@ -55,3 +53,5 @@ module Gitlab
end
end
end
+
+Gitlab::Checks::ChangeAccess.prepend_if_ee('EE::Gitlab::Checks::ChangeAccess')
diff --git a/lib/gitlab/checks/diff_check.rb b/lib/gitlab/checks/diff_check.rb
index a73f243e946..8780b410a07 100644
--- a/lib/gitlab/checks/diff_check.rb
+++ b/lib/gitlab/checks/diff_check.rb
@@ -4,7 +4,6 @@ module Gitlab
module Checks
class DiffCheck < BaseChecker
include Gitlab::Utils::StrongMemoize
- prepend_if_ee('EE::Gitlab::Checks::DiffCheck') # rubocop: disable Cop/InjectEnterpriseEditionModule
LOG_MESSAGES = {
validate_file_paths: "Validating diffs' file paths...",
@@ -97,3 +96,5 @@ module Gitlab
end
end
end
+
+Gitlab::Checks::DiffCheck.prepend_if_ee('EE::Gitlab::Checks::DiffCheck')
diff --git a/lib/gitlab/ci/parsers.rb b/lib/gitlab/ci/parsers.rb
index 5c7d74a10c5..84124ef654d 100644
--- a/lib/gitlab/ci/parsers.rb
+++ b/lib/gitlab/ci/parsers.rb
@@ -3,8 +3,6 @@
module Gitlab
module Ci
module Parsers
- prepend_if_ee('::EE::Gitlab::Ci::Parsers') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
ParserNotFoundError = Class.new(ParserError)
def self.parsers
@@ -23,3 +21,5 @@ module Gitlab
end
end
end
+
+Gitlab::Ci::Parsers.prepend_if_ee('::EE::Gitlab::Ci::Parsers')
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb
index 4fc5bfddf0c..c03f042d462 100644
--- a/lib/gitlab/diff/file.rb
+++ b/lib/gitlab/diff/file.rb
@@ -314,6 +314,10 @@ module Gitlab
@rich_viewer = rich_viewer_class&.new(self)
end
+ def alternate_viewer
+ alternate_viewer_class&.new(self)
+ end
+
def rendered_as_text?(ignore_errors: true)
simple_viewer.is_a?(DiffViewer::Text) && (ignore_errors || simple_viewer.render_error.nil?)
end
@@ -419,6 +423,17 @@ module Gitlab
return if collapsed?
return unless diffable?
return unless modified_file?
+
+ find_renderable_viewer_class(classes)
+ end
+
+ def alternate_viewer_class
+ return unless viewer.class == DiffViewer::Renamed
+
+ find_renderable_viewer_class(RICH_VIEWERS) || (DiffViewer::Text if text?)
+ end
+
+ def find_renderable_viewer_class(classes)
return if different_type? || external_storage_error?
verify_binary = !stored_externally?
diff --git a/lib/gitlab/wiki_pages.rb b/lib/gitlab/wiki_pages.rb
index 47f9aa1117f..dee885e74d1 100644
--- a/lib/gitlab/wiki_pages.rb
+++ b/lib/gitlab/wiki_pages.rb
@@ -11,5 +11,8 @@ module Gitlab
# through the GitLab web interface and API:
MAX_TITLE_BYTES = 245 # reserving 10 bytes for the file extension
MAX_DIRECTORY_BYTES = 255
+
+ # Limit the number of pages displayed in the wiki sidebar.
+ MAX_SIDEBAR_PAGES = 15
end
end