summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:41 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:41 +0000
commitd47f9d2304dbc3a23bba7fe7a5cd07218eeb41cd (patch)
tree4b4efa1ccd8246fba2dc9f8816d9d2c0268e9818 /app
parentc158fa8d69c704663d289341a014c44c062cda88 (diff)
downloadgitlab-ce-d47f9d2304dbc3a23bba7fe7a5cd07218eeb41cd.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/finders/group_members_finder.rb2
-rw-r--r--app/models/epic.rb2
-rw-r--r--app/models/project.rb2
-rw-r--r--app/models/snippet.rb4
-rw-r--r--app/services/system_hooks_service.rb2
-rw-r--r--app/views/admin/hooks/index.html.haml2
-rw-r--r--app/views/shared/file_hooks/_index.html.haml24
-rw-r--r--app/views/shared/plugins/_index.html.haml23
-rw-r--r--app/workers/all_queues.yml2
-rw-r--r--app/workers/file_hook_worker.rb (renamed from app/workers/plugin_worker.rb)6
10 files changed, 38 insertions, 31 deletions
diff --git a/app/finders/group_members_finder.rb b/app/finders/group_members_finder.rb
index 05151b4f1f3..ffa1552627a 100644
--- a/app/finders/group_members_finder.rb
+++ b/app/finders/group_members_finder.rb
@@ -36,6 +36,8 @@ class GroupMembersFinder < UnionFinder
relations << descendant_members
end
+ return GroupMember.none if relations.empty?
+
members = find_union(relations, GroupMember)
filter_members(members, params)
end
diff --git a/app/models/epic.rb b/app/models/epic.rb
index 8222bbf9656..1203c6c1fc3 100644
--- a/app/models/epic.rb
+++ b/app/models/epic.rb
@@ -5,7 +5,7 @@
class Epic < ApplicationRecord
include IgnorableColumns
- ignore_column :milestone_id, remove_after: '2019-12-15', remove_with: '12.7'
+ ignore_column :milestone_id, remove_after: '2020-02-01', remove_with: '12.8'
def self.link_reference_pattern
nil
diff --git a/app/models/project.rb b/app/models/project.rb
index c7c2a9e34fb..735c9ebda7f 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1325,7 +1325,7 @@ class Project < ApplicationRecord
end
def has_active_hooks?(hooks_scope = :push_hooks)
- hooks.hooks_for(hooks_scope).any? || SystemHook.hooks_for(hooks_scope).any? || Gitlab::Plugin.any?
+ hooks.hooks_for(hooks_scope).any? || SystemHook.hooks_for(hooks_scope).any? || Gitlab::FileHook.any?
end
def has_active_services?(hooks_scope = :push_hooks)
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 92746d28f05..b3b3de21dee 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -14,8 +14,12 @@ class Snippet < ApplicationRecord
include Editable
include Gitlab::SQL::Pattern
include FromUnion
+ include IgnorableColumns
+
extend ::Gitlab::Utils::Override
+ ignore_column :storage_version, remove_with: '12.9', remove_after: '2020-03-22'
+
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description
cache_markdown_field :content
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb
index 06d2037fb63..0d369c23b57 100644
--- a/app/services/system_hooks_service.rb
+++ b/app/services/system_hooks_service.rb
@@ -14,7 +14,7 @@ class SystemHooksService
hook.async_execute(data, 'system_hooks')
end
- Gitlab::Plugin.execute_all_async(data)
+ Gitlab::FileHook.execute_all_async(data)
end
private
diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml
index eed3ec74d60..1c14291b58e 100644
--- a/app/views/admin/hooks/index.html.haml
+++ b/app/views/admin/hooks/index.html.haml
@@ -11,4 +11,4 @@
= render 'shared/web_hooks/index', hooks: @hooks, hook_class: @hook.class
-= render 'shared/plugins/index'
+= render 'shared/file_hooks/index'
diff --git a/app/views/shared/file_hooks/_index.html.haml b/app/views/shared/file_hooks/_index.html.haml
new file mode 100644
index 00000000000..74eb6c94116
--- /dev/null
+++ b/app/views/shared/file_hooks/_index.html.haml
@@ -0,0 +1,24 @@
+- file_hooks = Gitlab::FileHook.files
+
+.row.prepend-top-default
+ .col-lg-4
+ %h4.prepend-top-0
+ = _('File Hooks')
+ %p
+ = _('File hooks are similar to system hooks but are executed as files instead of sending data to a URL.')
+ = link_to _('For more information, see the File Hooks documentation.'), help_page_path('administration/file_hooks')
+
+
+ .col-lg-8.append-bottom-default
+ - if file_hooks.any?
+ .card
+ .card-header
+ = _('File Hooks (%{count})') % { count: file_hooks.count }
+ %ul.content-list
+ - file_hooks.each do |file|
+ %li
+ .monospace
+ = File.basename(file)
+ - else
+ .card.bg-light.text-center
+ .nothing-here-block= _('No file hooks found.')
diff --git a/app/views/shared/plugins/_index.html.haml b/app/views/shared/plugins/_index.html.haml
deleted file mode 100644
index 9d230d12be2..00000000000
--- a/app/views/shared/plugins/_index.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-- plugins = Gitlab::Plugin.files
-
-.row.prepend-top-default
- .col-lg-4
- %h4.prepend-top-0
- Plugins
- %p
- #{link_to 'Plugins', help_page_path('administration/plugins')} are similar to
- system hooks but are executed as files instead of sending data to a URL.
-
- .col-lg-8.append-bottom-default
- - if plugins.any?
- .card
- .card-header
- Plugins (#{plugins.count})
- %ul.content-list
- - plugins.each do |file|
- %li
- .monospace
- = File.basename(file)
- - else
- .card.bg-light.text-center
- .nothing-here-block No plugins found.
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 330e9fafa69..62b37f52cce 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -158,7 +158,7 @@
- pages
- pages_domain_verification
- pages_domain_ssl_renewal
-- plugin
+- file_hook
- post_receive
- process_commit
- project_cache
diff --git a/app/workers/plugin_worker.rb b/app/workers/file_hook_worker.rb
index e708031abdf..24fc2d75d24 100644
--- a/app/workers/plugin_worker.rb
+++ b/app/workers/file_hook_worker.rb
@@ -1,16 +1,16 @@
# frozen_string_literal: true
-class PluginWorker
+class FileHookWorker
include ApplicationWorker
sidekiq_options retry: false
feature_category :integrations
def perform(file_name, data)
- success, message = Gitlab::Plugin.execute(file_name, data)
+ success, message = Gitlab::FileHook.execute(file_name, data)
unless success
- Gitlab::PluginLogger.error("Plugin Error => #{file_name}: #{message}")
+ Gitlab::FileHookLogger.error("File Hook Error => #{file_name}: #{message}")
end
true