summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities/runner_details.rb4
-rw-r--r--lib/gitlab/import_export/project/relation_factory.rb3
-rw-r--r--lib/gitlab/metrics/dashboard/stages/panel_ids_inserter.rb3
-rw-r--r--lib/tasks/gitlab/uploads/legacy.rake27
4 files changed, 8 insertions, 29 deletions
diff --git a/lib/api/entities/runner_details.rb b/lib/api/entities/runner_details.rb
index 17202821e6e..2bb143253fe 100644
--- a/lib/api/entities/runner_details.rb
+++ b/lib/api/entities/runner_details.rb
@@ -10,7 +10,11 @@ module API
expose :access_level
expose :version, :revision, :platform, :architecture
expose :contacted_at
+
+ # @deprecated in 12.10 https://gitlab.com/gitlab-org/gitlab/-/issues/214320
+ # will be removed by 13.0 https://gitlab.com/gitlab-org/gitlab/-/issues/214322
expose :token, if: lambda { |runner, options| options[:current_user].admin? || !runner.instance_type? }
+
# rubocop: disable CodeReuse/ActiveRecord
expose :projects, with: Entities::BasicProjectDetails do |runner, options|
if options[:current_user].admin?
diff --git a/lib/gitlab/import_export/project/relation_factory.rb b/lib/gitlab/import_export/project/relation_factory.rb
index 2405176c518..f7f1195f2f1 100644
--- a/lib/gitlab/import_export/project/relation_factory.rb
+++ b/lib/gitlab/import_export/project/relation_factory.rb
@@ -70,8 +70,7 @@ module Gitlab
# Do not create relation if it is:
# - An unknown service
# - A legacy trigger
- unknown_service? ||
- (!Feature.enabled?(:use_legacy_pipeline_triggers, @importable) && legacy_trigger?)
+ unknown_service? || legacy_trigger?
end
def setup_models
diff --git a/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter.rb b/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter.rb
index 301c54b9f23..239b5161256 100644
--- a/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter.rb
+++ b/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter.rb
@@ -15,6 +15,9 @@ module Gitlab
insert_panel_id(id, panel)
end
+ rescue ActiveModel::UnknownAttributeError => error
+ remove_panel_ids!
+ Gitlab::ErrorTracking.log_exception(error)
end
private
diff --git a/lib/tasks/gitlab/uploads/legacy.rake b/lib/tasks/gitlab/uploads/legacy.rake
deleted file mode 100644
index 74db0060b8d..00000000000
--- a/lib/tasks/gitlab/uploads/legacy.rake
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-namespace :gitlab do
- namespace :uploads do
- namespace :legacy do
- desc "GitLab | Uploads | Migrate all legacy attachments"
- task migrate: :environment do
- class Upload < ApplicationRecord
- self.table_name = 'uploads'
-
- include ::EachBatch
- end
-
- migration = 'LegacyUploadsMigrator'
- batch_size = 5000
- delay_interval = 5.minutes.to_i
-
- Upload.where(uploader: 'AttachmentUploader', model_type: 'Note').each_batch(of: batch_size) do |relation, index|
- start_id, end_id = relation.pluck('MIN(id), MAX(id)').first
- delay = index * delay_interval
-
- BackgroundMigrationWorker.perform_in(delay, migration, [start_id, end_id])
- end
- end
- end
- end
-end