summaryrefslogtreecommitdiff
path: root/lib
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 /lib
parentc158fa8d69c704663d289341a014c44c062cda88 (diff)
downloadgitlab-ce-d47f9d2304dbc3a23bba7fe7a5cd07218eeb41cd.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/database_importers/self_monitoring/project/delete_service.rb20
-rw-r--r--lib/gitlab/file_hook.rb (renamed from lib/gitlab/plugin.rb)4
-rw-r--r--lib/gitlab/file_hook_logger.rb (renamed from lib/gitlab/plugin_logger.rb)2
-rw-r--r--lib/gitlab/regex.rb2
-rw-r--r--lib/tasks/file_hooks.rake (renamed from lib/tasks/plugins.rake)8
5 files changed, 11 insertions, 25 deletions
diff --git a/lib/gitlab/database_importers/self_monitoring/project/delete_service.rb b/lib/gitlab/database_importers/self_monitoring/project/delete_service.rb
index bce0819b700..998977b4000 100644
--- a/lib/gitlab/database_importers/self_monitoring/project/delete_service.rb
+++ b/lib/gitlab/database_importers/self_monitoring/project/delete_service.rb
@@ -9,8 +9,7 @@ module Gitlab
include SelfMonitoring::Helpers
steps :validate_self_monitoring_project_exists,
- :destroy_project_owner,
- :delete_project_id
+ :destroy_project
def initialize
super(nil)
@@ -30,29 +29,16 @@ module Gitlab
success(result)
end
- def destroy_project_owner(result)
+ def destroy_project(result)
return success(result) unless project_created?
- if self_monitoring_project.owner.destroy
+ if self_monitoring_project.destroy
success(result)
else
log_error(self_monitoring_project.errors.full_messages)
error(_('Error deleting project. Check logs for error details.'))
end
end
-
- def delete_project_id(result)
- update_result = application_settings.update(
- instance_administration_project_id: nil
- )
-
- if update_result
- success(result)
- else
- log_error("Could not delete self monitoring project ID, errors: %{errors}" % { errors: application_settings.errors.full_messages })
- error(_('Could not delete project ID'))
- end
- end
end
end
end
diff --git a/lib/gitlab/plugin.rb b/lib/gitlab/file_hook.rb
index b6700f4733b..f886fd10f53 100644
--- a/lib/gitlab/plugin.rb
+++ b/lib/gitlab/file_hook.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Gitlab
- module Plugin
+ module FileHook
def self.any?
plugin_glob.any? { |entry| File.file?(entry) }
end
@@ -17,7 +17,7 @@ module Gitlab
def self.execute_all_async(data)
args = files.map { |file| [file, data] }
- PluginWorker.bulk_perform_async(args)
+ FileHookWorker.bulk_perform_async(args)
end
def self.execute(file, data)
diff --git a/lib/gitlab/plugin_logger.rb b/lib/gitlab/file_hook_logger.rb
index df3bd56fd2f..c5e69172016 100644
--- a/lib/gitlab/plugin_logger.rb
+++ b/lib/gitlab/file_hook_logger.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Gitlab
- class PluginLogger < Gitlab::Logger
+ class FileHookLogger < Gitlab::Logger
def self.file_name_noext
'plugin'
end
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index d9300da38a5..48eaf073e8a 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -5,7 +5,7 @@ module Gitlab
extend self
def project_name_regex
- @project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9c0}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9c0}_\. ]*\z/.freeze
+ @project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_\. ]*\z/.freeze
end
def project_name_regex_message
diff --git a/lib/tasks/plugins.rake b/lib/tasks/file_hooks.rake
index e73dd7e68df..20a726de65b 100644
--- a/lib/tasks/plugins.rake
+++ b/lib/tasks/file_hooks.rake
@@ -1,10 +1,10 @@
-namespace :plugins do
+namespace :file_hooks do
desc 'Validate existing plugins'
task validate: :environment do
- puts 'Validating plugins from /plugins directory'
+ puts 'Validating file hooks from /plugins directory'
- Gitlab::Plugin.files.each do |file|
- success, message = Gitlab::Plugin.execute(file, Gitlab::DataBuilder::Push::SAMPLE_DATA)
+ Gitlab::FileHook.files.each do |file|
+ success, message = Gitlab::FileHook.execute(file, Gitlab::DataBuilder::Push::SAMPLE_DATA)
if success
puts "* #{file} succeed (zero exit code)."