...@@ -36,6 +36,8 @@ class GroupMembersFinder < UnionFinder ...@@ -36,6 +36,8 @@ class GroupMembersFinder < UnionFinder
relations << descendant_members relations << descendant_members
end end
return GroupMember.none if relations.empty?
members = find_union(relations, GroupMember) members = find_union(relations, GroupMember)
filter_members(members, params) filter_members(members, params)
end end
... ...
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
class Epic < ApplicationRecord class Epic < ApplicationRecord
include IgnorableColumns 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 def self.link_reference_pattern
nil nil
... ...
......
...@@ -1325,7 +1325,7 @@ class Project < ApplicationRecord ...@@ -1325,7 +1325,7 @@ class Project < ApplicationRecord
end end
def has_active_hooks?(hooks_scope = :push_hooks) 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 end
def has_active_services?(hooks_scope = :push_hooks) def has_active_services?(hooks_scope = :push_hooks)
... ...
......
...@@ -14,8 +14,12 @@ class Snippet < ApplicationRecord ...@@ -14,8 +14,12 @@ class Snippet < ApplicationRecord
include Editable include Editable
include Gitlab::SQL::Pattern include Gitlab::SQL::Pattern
include FromUnion include FromUnion
include IgnorableColumns
extend ::Gitlab::Utils::Override 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 :title, pipeline: :single_line
cache_markdown_field :description cache_markdown_field :description
cache_markdown_field :content cache_markdown_field :content
... ...
......
...@@ -14,7 +14,7 @@ class SystemHooksService ...@@ -14,7 +14,7 @@ class SystemHooksService
hook.async_execute(data, 'system_hooks') hook.async_execute(data, 'system_hooks')
end end
Gitlab::Plugin.execute_all_async(data) Gitlab::FileHook.execute_all_async(data)
end end
private private
... ...
......
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
= render 'shared/web_hooks/index', hooks: @hooks, hook_class: @hook.class = render 'shared/web_hooks/index', hooks: @hooks, hook_class: @hook.class
= render 'shared/plugins/index' = render 'shared/file_hooks/index'
- plugins = Gitlab::Plugin.files - file_hooks = Gitlab::FileHook.files
.row.prepend-top-default .row.prepend-top-default
.col-lg-4 .col-lg-4
%h4.prepend-top-0 %h4.prepend-top-0
Plugins = _('File Hooks')
%p %p
#{link_to 'Plugins', help_page_path('administration/plugins')} are similar to = _('File hooks are similar to system hooks but are executed as files instead of sending data to a URL.')
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 .col-lg-8.append-bottom-default
- if plugins.any? - if file_hooks.any?
.card .card
.card-header .card-header
Plugins (#{plugins.count}) = _('File Hooks (%{count})') % { count: file_hooks.count }
%ul.content-list %ul.content-list
- plugins.each do |file| - file_hooks.each do |file|
%li %li
.monospace .monospace
= File.basename(file) = File.basename(file)
- else - else
.card.bg-light.text-center .card.bg-light.text-center
.nothing-here-block No plugins found. .nothing-here-block= _('No file hooks found.')
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
- pages - pages
- pages_domain_verification - pages_domain_verification
- pages_domain_ssl_renewal - pages_domain_ssl_renewal
- plugin - file_hook
- post_receive - post_receive
- process_commit - process_commit
- project_cache - project_cache
... ...
......
# frozen_string_literal: true # frozen_string_literal: true
class PluginWorker class FileHookWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options retry: false sidekiq_options retry: false
feature_category :integrations feature_category :integrations
def perform(file_name, data) def perform(file_name, data)
success, message = Gitlab::Plugin.execute(file_name, data) success, message = Gitlab::FileHook.execute(file_name, data)
unless success unless success
Gitlab::PluginLogger.error("Plugin Error => #{file_name}: #{message}") Gitlab::FileHookLogger.error("File Hook Error => #{file_name}: #{message}")
end end
true true
... ...
......
---
title: 'Resolve Design View: Left/Right keyboard arrows through Designs'
merge_request: 22870
author:
type: added
---
title: Add returning relation from GroupMembersFinder if called on root group with
only inherited param
merge_request: 23161
author:
type: fixed
---
title: Allow Unicode 11 emojis in project names
merge_request: 22776
author: Harm Berntsen
type: changed
---
title: Added Conan installation instructions to Conan package details page
merge_request: 22390
author:
type: added
---
title: Rename GitLab Plugins feature to GitLab File Hooks
merge_request: 22979
author:
type: changed
---
title: Remove storage_version column from snippets
merge_request: 23004
author:
type: changed
---
title: Remove milestone_id from epics
merge_request: 20539
author: Lee Tickett
type: other
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
- [pages_domain_ssl_renewal, 1] - [pages_domain_ssl_renewal, 1]
- [object_storage_upload, 1] - [object_storage_upload, 1]
- [object_storage, 1] - [object_storage, 1]
- [plugin, 1] - [file_hook, 1]
- [pipeline_background, 1] - [pipeline_background, 1]
- [repository_update_remote_mirror, 1] - [repository_update_remote_mirror, 1]
- [repository_remove_remote, 1] - [repository_remove_remote, 1]
... ...
......
# frozen_string_literal: true
class RemoveMilestoneIdFromEpics < ActiveRecord::Migration[5.2]
DOWNTIME = false
def up
remove_column :epics, :milestone_id
end
def down
add_column :epics, :milestone_id, :integer
end
end
# frozen_string_literal: true
class RemoveStorageVersionColumnFromSnippets < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
return unless column_exists?(:snippets, :storage_version)
remove_column :snippets, :storage_version
end
def down
add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault
:snippets,
:storage_version,
:integer,
default: 2,
allow_null: false
)
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_01_14_180546) do ActiveRecord::Schema.define(version: 2020_01_14_113341) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm" enable_extension "pg_trgm"
...@@ -1538,7 +1538,6 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do ...@@ -1538,7 +1538,6 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do
end end
create_table "epics", id: :serial, force: :cascade do |t| create_table "epics", id: :serial, force: :cascade do |t|
t.integer "milestone_id"
t.integer "group_id", null: false t.integer "group_id", null: false
t.integer "author_id", null: false t.integer "author_id", null: false
t.integer "assignee_id" t.integer "assignee_id"
...@@ -1577,7 +1576,6 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do ...@@ -1577,7 +1576,6 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do
t.index ["end_date"], name: "index_epics_on_end_date" t.index ["end_date"], name: "index_epics_on_end_date"
t.index ["group_id"], name: "index_epics_on_group_id" t.index ["group_id"], name: "index_epics_on_group_id"
t.index ["iid"], name: "index_epics_on_iid" t.index ["iid"], name: "index_epics_on_iid"
t.index ["milestone_id"], name: "index_milestone"
t.index ["parent_id"], name: "index_epics_on_parent_id" t.index ["parent_id"], name: "index_epics_on_parent_id"
t.index ["start_date"], name: "index_epics_on_start_date" t.index ["start_date"], name: "index_epics_on_start_date"
t.index ["start_date_sourcing_epic_id"], name: "index_epics_on_start_date_sourcing_epic_id", where: "(start_date_sourcing_epic_id IS NOT NULL)" t.index ["start_date_sourcing_epic_id"], name: "index_epics_on_start_date_sourcing_epic_id", where: "(start_date_sourcing_epic_id IS NOT NULL)"
...@@ -3838,6 +3836,7 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do ...@@ -3838,6 +3836,7 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do
t.string "encrypted_secret_token_iv", limit: 255 t.string "encrypted_secret_token_iv", limit: 255
t.boolean "secret", default: false, null: false t.boolean "secret", default: false, null: false
t.string "repository_storage", limit: 255, default: "default", null: false t.string "repository_storage", limit: 255, default: "default", null: false
t.integer "storage_version", default: 2, null: false
t.index ["author_id"], name: "index_snippets_on_author_id" t.index ["author_id"], name: "index_snippets_on_author_id"
t.index ["content"], name: "index_snippets_on_content_trigram", opclass: :gin_trgm_ops, using: :gin t.index ["content"], name: "index_snippets_on_content_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["created_at"], name: "index_snippets_on_created_at" t.index ["created_at"], name: "index_snippets_on_created_at"
...@@ -4590,7 +4589,6 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do ...@@ -4590,7 +4589,6 @@ ActiveRecord::Schema.define(version: 2020_01_14_180546) do
add_foreign_key "epics", "epics", column: "start_date_sourcing_epic_id", name: "fk_9d480c64b2", on_delete: :nullify add_foreign_key "epics", "epics", column: "start_date_sourcing_epic_id", name: "fk_9d480c64b2", on_delete: :nullify
add_foreign_key "epics", "milestones", column: "due_date_sourcing_milestone_id", name: "fk_3c1fd1cccc", on_delete: :nullify add_foreign_key "epics", "milestones", column: "due_date_sourcing_milestone_id", name: "fk_3c1fd1cccc", on_delete: :nullify
add_foreign_key "epics", "milestones", column: "start_date_sourcing_milestone_id", name: "fk_1fbed67632", on_delete: :nullify add_foreign_key "epics", "milestones", column: "start_date_sourcing_milestone_id", name: "fk_1fbed67632", on_delete: :nullify
add_foreign_key "epics", "milestones", on_delete: :nullify
add_foreign_key "epics", "namespaces", column: "group_id", name: "fk_f081aa4489", on_delete: :cascade add_foreign_key "epics", "namespaces", column: "group_id", name: "fk_f081aa4489", on_delete: :cascade
add_foreign_key "epics", "users", column: "assignee_id", name: "fk_dccd3f98fc", on_delete: :nullify add_foreign_key "epics", "users", column: "assignee_id", name: "fk_dccd3f98fc", on_delete: :nullify
add_foreign_key "epics", "users", column: "author_id", name: "fk_3654b61b03", on_delete: :cascade add_foreign_key "epics", "users", column: "author_id", name: "fk_3654b61b03", on_delete: :cascade
... ...
......