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-02-17 15:09:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 15:09:20 +0300
commitb84eeb256c4a780d902faee1f99ca9a711b3214a (patch)
tree32918aadbea9210eace50efbce9afbfb8cd3ba84 /lib
parent53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities/application_setting.rb2
-rw-r--r--lib/api/entities/board.rb2
-rw-r--r--lib/api/entities/group.rb2
-rw-r--r--lib/api/entities/group_detail.rb2
-rw-r--r--lib/api/entities/identity.rb2
-rw-r--r--lib/api/entities/issue.rb2
-rw-r--r--lib/api/entities/issue_basic.rb2
-rw-r--r--lib/api/entities/list.rb2
-rw-r--r--lib/api/entities/member.rb2
-rw-r--r--lib/api/entities/merge_request_basic.rb2
-rw-r--r--lib/api/entities/namespace.rb2
-rw-r--r--lib/api/entities/project.rb (renamed from lib/api/entities.rb)19
-rw-r--r--lib/api/entities/protected_branch.rb2
-rw-r--r--lib/api/entities/protected_ref_access.rb2
-rw-r--r--lib/api/entities/todo.rb2
-rw-r--r--lib/api/entities/user_public.rb2
-rw-r--r--lib/api/entities/user_with_admin.rb2
-rw-r--r--lib/gitlab/ci/parsers/test/junit.rb5
-rw-r--r--lib/gitlab/ci/reports/test_reports_comparer.rb2
-rw-r--r--lib/gitlab/ci/reports/test_suite_comparer.rb30
-rw-r--r--lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml2
-rw-r--r--lib/gitlab/runtime.rb10
22 files changed, 72 insertions, 28 deletions
diff --git a/lib/api/entities/application_setting.rb b/lib/api/entities/application_setting.rb
index 6ca2d1e6da4..e9572a8d430 100644
--- a/lib/api/entities/application_setting.rb
+++ b/lib/api/entities/application_setting.rb
@@ -34,3 +34,5 @@ module API
end
end
end
+
+API::Entities::ApplicationSetting.prepend_if_ee('EE::API::Entities::ApplicationSetting')
diff --git a/lib/api/entities/board.rb b/lib/api/entities/board.rb
index afbf5b4b65b..5bb1cde0fa9 100644
--- a/lib/api/entities/board.rb
+++ b/lib/api/entities/board.rb
@@ -12,3 +12,5 @@ module API
end
end
end
+
+API::Entities::Board.prepend_if_ee('EE::API::Entities::Board')
diff --git a/lib/api/entities/group.rb b/lib/api/entities/group.rb
index 8bcad5bca35..ae5ee4784ed 100644
--- a/lib/api/entities/group.rb
+++ b/lib/api/entities/group.rb
@@ -34,3 +34,5 @@ module API
end
end
end
+
+API::Entities::Group.prepend_if_ee('EE::API::Entities::Group', with_descendants: true)
diff --git a/lib/api/entities/group_detail.rb b/lib/api/entities/group_detail.rb
index 97b98aac585..e03047a6e75 100644
--- a/lib/api/entities/group_detail.rb
+++ b/lib/api/entities/group_detail.rb
@@ -34,3 +34,5 @@ module API
end
end
end
+
+API::Entities::GroupDetail.prepend_if_ee('EE::API::Entities::GroupDetail')
diff --git a/lib/api/entities/identity.rb b/lib/api/entities/identity.rb
index 8969a0256c7..52045b6250a 100644
--- a/lib/api/entities/identity.rb
+++ b/lib/api/entities/identity.rb
@@ -7,3 +7,5 @@ module API
end
end
end
+
+API::Entities::Identity.prepend_if_ee('EE::API::Entities::Identity')
diff --git a/lib/api/entities/issue.rb b/lib/api/entities/issue.rb
index b7eb22b2aba..5f2609cf68b 100644
--- a/lib/api/entities/issue.rb
+++ b/lib/api/entities/issue.rb
@@ -46,3 +46,5 @@ module API
end
end
end
+
+API::Entities::Issue.prepend_if_ee('EE::API::Entities::Issue')
diff --git a/lib/api/entities/issue_basic.rb b/lib/api/entities/issue_basic.rb
index 7e4be35d20b..af92f4124f1 100644
--- a/lib/api/entities/issue_basic.rb
+++ b/lib/api/entities/issue_basic.rb
@@ -41,3 +41,5 @@ module API
end
end
end
+
+API::Entities::IssueBasic.prepend_if_ee('EE::API::Entities::IssueBasic', with_descendants: true)
diff --git a/lib/api/entities/list.rb b/lib/api/entities/list.rb
index e856359efc1..480e722c22c 100644
--- a/lib/api/entities/list.rb
+++ b/lib/api/entities/list.rb
@@ -9,3 +9,5 @@ module API
end
end
end
+
+API::Entities::List.prepend_if_ee('EE::API::Entities::List')
diff --git a/lib/api/entities/member.rb b/lib/api/entities/member.rb
index 558f37d1a56..14e97f41e77 100644
--- a/lib/api/entities/member.rb
+++ b/lib/api/entities/member.rb
@@ -9,3 +9,5 @@ module API
end
end
end
+
+API::Entities::Member.prepend_if_ee('EE::API::Entities::Member', with_descendants: true)
diff --git a/lib/api/entities/merge_request_basic.rb b/lib/api/entities/merge_request_basic.rb
index ce8bfa9e670..8cec2c1a97e 100644
--- a/lib/api/entities/merge_request_basic.rb
+++ b/lib/api/entities/merge_request_basic.rb
@@ -92,3 +92,5 @@ module API
end
end
end
+
+API::Entities::MergeRequestBasic.prepend_if_ee('EE::API::Entities::MergeRequestBasic', with_descendants: true)
diff --git a/lib/api/entities/namespace.rb b/lib/api/entities/namespace.rb
index b21dd29c7b4..a7e06cc3e02 100644
--- a/lib/api/entities/namespace.rb
+++ b/lib/api/entities/namespace.rb
@@ -13,3 +13,5 @@ module API
end
end
end
+
+API::Entities::Namespace.prepend_if_ee('EE::API::Entities::Namespace')
diff --git a/lib/api/entities.rb b/lib/api/entities/project.rb
index 479d662f3f5..6ed2ed34360 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities/project.rb
@@ -131,21 +131,4 @@ module API
end
end
-# rubocop: disable Cop/InjectEnterpriseEditionModule
-::API::Entities::ApplicationSetting.prepend_if_ee('EE::API::Entities::ApplicationSetting')
-::API::Entities::Board.prepend_if_ee('EE::API::Entities::Board')
-::API::Entities::Group.prepend_if_ee('EE::API::Entities::Group', with_descendants: true)
-::API::Entities::GroupDetail.prepend_if_ee('EE::API::Entities::GroupDetail')
-::API::Entities::IssueBasic.prepend_if_ee('EE::API::Entities::IssueBasic', with_descendants: true)
-::API::Entities::Issue.prepend_if_ee('EE::API::Entities::Issue')
-::API::Entities::List.prepend_if_ee('EE::API::Entities::List')
-::API::Entities::MergeRequestBasic.prepend_if_ee('EE::API::Entities::MergeRequestBasic', with_descendants: true)
-::API::Entities::Member.prepend_if_ee('EE::API::Entities::Member', with_descendants: true)
-::API::Entities::Namespace.prepend_if_ee('EE::API::Entities::Namespace')
-::API::Entities::Project.prepend_if_ee('EE::API::Entities::Project', with_descendants: true)
-::API::Entities::ProtectedRefAccess.prepend_if_ee('EE::API::Entities::ProtectedRefAccess')
-::API::Entities::UserPublic.prepend_if_ee('EE::API::Entities::UserPublic', with_descendants: true)
-::API::Entities::Todo.prepend_if_ee('EE::API::Entities::Todo')
-::API::Entities::ProtectedBranch.prepend_if_ee('EE::API::Entities::ProtectedBranch')
-::API::Entities::Identity.prepend_if_ee('EE::API::Entities::Identity')
-::API::Entities::UserWithAdmin.prepend_if_ee('EE::API::Entities::UserWithAdmin', with_descendants: true)
+API::Entities::Project.prepend_if_ee('EE::API::Entities::Project', with_descendants: true)
diff --git a/lib/api/entities/protected_branch.rb b/lib/api/entities/protected_branch.rb
index e41d497c836..80c8a791053 100644
--- a/lib/api/entities/protected_branch.rb
+++ b/lib/api/entities/protected_branch.rb
@@ -10,3 +10,5 @@ module API
end
end
end
+
+API::Entities::ProtectedBranch.prepend_if_ee('EE::API::Entities::ProtectedBranch')
diff --git a/lib/api/entities/protected_ref_access.rb b/lib/api/entities/protected_ref_access.rb
index ab878be45d2..f0185705b06 100644
--- a/lib/api/entities/protected_ref_access.rb
+++ b/lib/api/entities/protected_ref_access.rb
@@ -10,3 +10,5 @@ module API
end
end
end
+
+API::Entities::ProtectedRefAccess.prepend_if_ee('EE::API::Entities::ProtectedRefAccess')
diff --git a/lib/api/entities/todo.rb b/lib/api/entities/todo.rb
index 820d1ceaadd..abfdde89bf1 100644
--- a/lib/api/entities/todo.rb
+++ b/lib/api/entities/todo.rb
@@ -44,3 +44,5 @@ module API
end
end
end
+
+API::Entities::Todo.prepend_if_ee('EE::API::Entities::Todo')
diff --git a/lib/api/entities/user_public.rb b/lib/api/entities/user_public.rb
index 100f73760ca..15e9b905bef 100644
--- a/lib/api/entities/user_public.rb
+++ b/lib/api/entities/user_public.rb
@@ -17,3 +17,5 @@ module API
end
end
end
+
+API::Entities::UserPublic.prepend_if_ee('EE::API::Entities::UserPublic', with_descendants: true)
diff --git a/lib/api/entities/user_with_admin.rb b/lib/api/entities/user_with_admin.rb
index c2f873ae802..d3df12200ff 100644
--- a/lib/api/entities/user_with_admin.rb
+++ b/lib/api/entities/user_with_admin.rb
@@ -7,3 +7,5 @@ module API
end
end
end
+
+API::Entities::UserWithAdmin.prepend_if_ee('EE::API::Entities::UserWithAdmin', with_descendants: true)
diff --git a/lib/gitlab/ci/parsers/test/junit.rb b/lib/gitlab/ci/parsers/test/junit.rb
index 8f8cae0b5f2..133eb16a83e 100644
--- a/lib/gitlab/ci/parsers/test/junit.rb
+++ b/lib/gitlab/ci/parsers/test/junit.rb
@@ -50,10 +50,7 @@ module Gitlab
status = ::Gitlab::Ci::Reports::TestCase::STATUS_FAILED
system_output = data['failure']
elsif data['error']
- # For now, as an MVC, we are grouping error test cases together
- # with failed ones. But we will improve this further on
- # https://gitlab.com/gitlab-org/gitlab/issues/32046.
- status = ::Gitlab::Ci::Reports::TestCase::STATUS_FAILED
+ status = ::Gitlab::Ci::Reports::TestCase::STATUS_ERROR
system_output = data['error']
else
status = ::Gitlab::Ci::Reports::TestCase::STATUS_SUCCESS
diff --git a/lib/gitlab/ci/reports/test_reports_comparer.rb b/lib/gitlab/ci/reports/test_reports_comparer.rb
index 11810bdc0a8..c6f17f0764f 100644
--- a/lib/gitlab/ci/reports/test_reports_comparer.rb
+++ b/lib/gitlab/ci/reports/test_reports_comparer.rb
@@ -29,7 +29,7 @@ module Gitlab
end
end
- %w(total_count resolved_count failed_count).each do |method|
+ %w(total_count resolved_count failed_count error_count).each do |method|
define_method(method) do
# rubocop: disable CodeReuse/ActiveRecord
suite_comparers.sum { |suite| suite.public_send(method) } # rubocop:disable GitlabSecurity/PublicSend
diff --git a/lib/gitlab/ci/reports/test_suite_comparer.rb b/lib/gitlab/ci/reports/test_suite_comparer.rb
index 9cb7db5934c..a58de43e55e 100644
--- a/lib/gitlab/ci/reports/test_suite_comparer.rb
+++ b/lib/gitlab/ci/reports/test_suite_comparer.rb
@@ -38,6 +38,30 @@ module Gitlab
end
end
+ def new_errors
+ strong_memoize(:new_errors) do
+ head_suite.error.reject do |key, _|
+ base_suite.error.include?(key)
+ end.values
+ end
+ end
+
+ def existing_errors
+ strong_memoize(:existing_errors) do
+ head_suite.error.select do |key, _|
+ base_suite.error.include?(key)
+ end.values
+ end
+ end
+
+ def resolved_errors
+ strong_memoize(:resolved_errors) do
+ head_suite.success.select do |key, _|
+ base_suite.error.include?(key)
+ end.values
+ end
+ end
+
def total_count
head_suite.total_count
end
@@ -47,12 +71,16 @@ module Gitlab
end
def resolved_count
- resolved_failures.count
+ resolved_failures.count + resolved_errors.count
end
def failed_count
new_failures.count + existing_failures.count
end
+
+ def error_count
+ new_errors.count + existing_errors.count
+ end
end
end
end
diff --git a/lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml b/lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml
index 5c790f3e0ab..2333fb4e947 100644
--- a/lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml
@@ -27,7 +27,7 @@ license_scanning:
refs:
- branches
variables:
- - $GITLAB_FEATURES =~ /\blicense_management\b/
+ - $GITLAB_FEATURES =~ /\blicense_scanning\b/
except:
variables:
- $LICENSE_MANAGEMENT_DISABLED
diff --git a/lib/gitlab/runtime.rb b/lib/gitlab/runtime.rb
index 3f6361c7276..bf579dd3b77 100644
--- a/lib/gitlab/runtime.rb
+++ b/lib/gitlab/runtime.rb
@@ -78,12 +78,16 @@ module Gitlab
end
def max_threads
+ main_thread = 1
+
if puma?
- Puma.cli_config.options[:max_threads]
+ Puma.cli_config.options[:max_threads] + main_thread
elsif sidekiq?
- Sidekiq.options[:concurrency]
+ # An extra thread for the poller in Sidekiq Cron:
+ # https://github.com/ondrejbartas/sidekiq-cron#under-the-hood
+ Sidekiq.options[:concurrency] + main_thread + 1
else
- 1
+ main_thread
end
end
end