diff options
Diffstat (limited to 'rubocop/cop/gitlab')
-rw-r--r-- | rubocop/cop/gitlab/bulk_insert.rb | 6 | ||||
-rw-r--r-- | rubocop/cop/gitlab/change_timezone.rb (renamed from rubocop/cop/gitlab/change_timzone.rb) | 0 | ||||
-rw-r--r-- | rubocop/cop/gitlab/keys_first_and_values_first.rb (renamed from rubocop/cop/gitlab/keys-first-and-values-first.rb) | 0 | ||||
-rw-r--r-- | rubocop/cop/gitlab/mark_used_feature_flags.rb | 9 |
4 files changed, 11 insertions, 4 deletions
diff --git a/rubocop/cop/gitlab/bulk_insert.rb b/rubocop/cop/gitlab/bulk_insert.rb index 4c8c232043f..baaefc2533c 100644 --- a/rubocop/cop/gitlab/bulk_insert.rb +++ b/rubocop/cop/gitlab/bulk_insert.rb @@ -3,13 +3,13 @@ module RuboCop module Cop module Gitlab - # Cop that disallows the use of `Gitlab::Database.main.bulk_insert`, in favour of using + # Cop that disallows the use of `legacy_bulk_insert`, in favour of using # the `BulkInsertSafe` module. class BulkInsert < RuboCop::Cop::Cop - MSG = 'Use the `BulkInsertSafe` concern, instead of using `Gitlab::Database.main.bulk_insert`. See https://docs.gitlab.com/ee/development/insert_into_tables_in_batches.html' + MSG = 'Use the `BulkInsertSafe` concern, instead of using `LegacyBulkInsert.bulk_insert`. See https://docs.gitlab.com/ee/development/insert_into_tables_in_batches.html' def_node_matcher :raw_union?, <<~PATTERN - (send (send (const (const _ :Gitlab) :Database) :main) :bulk_insert ...) + (send _ :legacy_bulk_insert ...) PATTERN def on_send(node) diff --git a/rubocop/cop/gitlab/change_timzone.rb b/rubocop/cop/gitlab/change_timezone.rb index c30a057d51c..c30a057d51c 100644 --- a/rubocop/cop/gitlab/change_timzone.rb +++ b/rubocop/cop/gitlab/change_timezone.rb diff --git a/rubocop/cop/gitlab/keys-first-and-values-first.rb b/rubocop/cop/gitlab/keys_first_and_values_first.rb index e9bf266cdd7..e9bf266cdd7 100644 --- a/rubocop/cop/gitlab/keys-first-and-values-first.rb +++ b/rubocop/cop/gitlab/keys_first_and_values_first.rb diff --git a/rubocop/cop/gitlab/mark_used_feature_flags.rb b/rubocop/cop/gitlab/mark_used_feature_flags.rb index 03ee4805f4e..d3c5cfb827e 100644 --- a/rubocop/cop/gitlab/mark_used_feature_flags.rb +++ b/rubocop/cop/gitlab/mark_used_feature_flags.rb @@ -255,10 +255,17 @@ module RuboCop ] # For EE additionally process `ee/` feature flags - if File.exist?(File.expand_path('../../../ee/app/models/license.rb', __dir__)) && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s) + is_ee = File.exist?(File.expand_path('../../../ee/app/models/license.rb', __dir__)) && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s) + if is_ee flags_paths << 'ee/config/feature_flags/**/*.yml' end + # For JH additionally process `jh/` feature flags + is_jh = is_ee && Dir.exist?(File.expand_path('../../../jh', __dir__)) && !%w[true 1].include?(ENV['EE_ONLY'].to_s) + if is_jh + flags_paths << 'jh/config/feature_flags/**/*.yml' + end + flags_paths.each_with_object([]) do |flags_path, memo| flags_path = File.expand_path("../../../#{flags_path}", __dir__) Dir.glob(flags_path).each do |path| |