summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-27 18:09:04 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-27 18:09:04 +0000
commit390582e118752426acf5cb25ec99103d312d891c (patch)
treebb0b1a6a46632024ffc3ba1983e4ebcb0fab4428 /lib
parent1ea1db491c8bc90789acda45c9002aaa5c4dc498 (diff)
downloadgitlab-ce-390582e118752426acf5cb25ec99103d312d891c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb46
-rw-r--r--lib/api/entities/hook.rb10
-rw-r--r--lib/api/entities/project_export_status.rb20
-rw-r--r--lib/api/entities/project_hook.rb12
-rw-r--r--lib/api/entities/project_identity.rb12
-rw-r--r--lib/api/entities/shared_group.rb17
-rw-r--r--lib/gitlab/git/rugged_impl/use_rugged.rb4
7 files changed, 74 insertions, 47 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index f68365e6325..ae23d3c9347 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -2,52 +2,6 @@
module API
module Entities
- class Hook < Grape::Entity
- expose :id, :url, :created_at, :push_events, :tag_push_events, :merge_requests_events, :repository_update_events
- expose :enable_ssl_verification
- end
-
- class ProjectHook < Hook
- expose :project_id, :issues_events, :confidential_issues_events
- expose :note_events, :confidential_note_events, :pipeline_events, :wiki_page_events
- expose :job_events
- expose :push_events_branch_filter
- end
-
- class SharedGroup < Grape::Entity
- expose :group_id
- expose :group_name do |group_link, options|
- group_link.group.name
- end
- expose :group_full_path do |group_link, options|
- group_link.group.full_path
- end
- expose :group_access, as: :group_access_level
- expose :expires_at
- end
-
- class ProjectIdentity < Grape::Entity
- expose :id, :description
- expose :name, :name_with_namespace
- expose :path, :path_with_namespace
- expose :created_at
- end
-
- class ProjectExportStatus < ProjectIdentity
- include ::API::Helpers::RelatedResourcesHelpers
-
- expose :export_status
- expose :_links, if: lambda { |project, _options| project.export_status == :finished } do
- expose :api_url do |project|
- expose_url(api_v4_projects_export_download_path(id: project.id))
- end
-
- expose :web_url do |project|
- Gitlab::Routing.url_helpers.download_export_project_url(project)
- end
- end
- end
-
class RemoteMirror < Grape::Entity
expose :id
expose :enabled
diff --git a/lib/api/entities/hook.rb b/lib/api/entities/hook.rb
new file mode 100644
index 00000000000..ac813bcac3f
--- /dev/null
+++ b/lib/api/entities/hook.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class Hook < Grape::Entity
+ expose :id, :url, :created_at, :push_events, :tag_push_events, :merge_requests_events, :repository_update_events
+ expose :enable_ssl_verification
+ end
+ end
+end
diff --git a/lib/api/entities/project_export_status.rb b/lib/api/entities/project_export_status.rb
new file mode 100644
index 00000000000..ad84a45996a
--- /dev/null
+++ b/lib/api/entities/project_export_status.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class ProjectExportStatus < ProjectIdentity
+ include ::API::Helpers::RelatedResourcesHelpers
+
+ expose :export_status
+ expose :_links, if: lambda { |project, _options| project.export_status == :finished } do
+ expose :api_url do |project|
+ expose_url(api_v4_projects_export_download_path(id: project.id))
+ end
+
+ expose :web_url do |project|
+ Gitlab::Routing.url_helpers.download_export_project_url(project)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/api/entities/project_hook.rb b/lib/api/entities/project_hook.rb
new file mode 100644
index 00000000000..cdd3714ed64
--- /dev/null
+++ b/lib/api/entities/project_hook.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class ProjectHook < Hook
+ expose :project_id, :issues_events, :confidential_issues_events
+ expose :note_events, :confidential_note_events, :pipeline_events, :wiki_page_events
+ expose :job_events
+ expose :push_events_branch_filter
+ end
+ end
+end
diff --git a/lib/api/entities/project_identity.rb b/lib/api/entities/project_identity.rb
new file mode 100644
index 00000000000..2055195eea0
--- /dev/null
+++ b/lib/api/entities/project_identity.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class ProjectIdentity < Grape::Entity
+ expose :id, :description
+ expose :name, :name_with_namespace
+ expose :path, :path_with_namespace
+ expose :created_at
+ end
+ end
+end
diff --git a/lib/api/entities/shared_group.rb b/lib/api/entities/shared_group.rb
new file mode 100644
index 00000000000..862e73e07f0
--- /dev/null
+++ b/lib/api/entities/shared_group.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module API
+ module Entities
+ class SharedGroup < Grape::Entity
+ expose :group_id
+ expose :group_name do |group_link, options|
+ group_link.group.name
+ end
+ expose :group_full_path do |group_link, options|
+ group_link.group.full_path
+ end
+ expose :group_access, as: :group_access_level
+ expose :expires_at
+ end
+ end
+end
diff --git a/lib/gitlab/git/rugged_impl/use_rugged.rb b/lib/gitlab/git/rugged_impl/use_rugged.rb
index 068aaf03c51..f63e35030c1 100644
--- a/lib/gitlab/git/rugged_impl/use_rugged.rb
+++ b/lib/gitlab/git/rugged_impl/use_rugged.rb
@@ -16,7 +16,9 @@ module Gitlab
end
def running_puma_with_multiple_threads?
- Gitlab::Runtime.puma? && ::Puma.cli_config.options[:max_threads] > 1
+ return false unless Gitlab::Runtime.puma?
+
+ ::Puma.respond_to?(:cli_config) && ::Puma.cli_config.options[:max_threads] > 1
end
def execute_rugged_call(method_name, *args)