diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-11 03:11:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-11 03:11:52 +0300 |
commit | 29b547f00429a063b266f6e6e478bba92c6a167a (patch) | |
tree | 5fbb39c281630f5c140c132b8a8894df1e92a516 /rubocop | |
parent | 5f722a35635ac0a883d17ed6173cbebdb9a87477 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r-- | rubocop/cop/migration/prevent_index_creation.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rubocop/cop/migration/prevent_index_creation.rb b/rubocop/cop/migration/prevent_index_creation.rb index 4c39032eb0f..aa0ab7b1e50 100644 --- a/rubocop/cop/migration/prevent_index_creation.rb +++ b/rubocop/cop/migration/prevent_index_creation.rb @@ -8,9 +8,11 @@ module RuboCop class PreventIndexCreation < RuboCop::Cop::Base include MigrationHelpers - FORBIDDEN_TABLES = %i[ci_builds].freeze + FORBIDDEN_TABLES = %i[ci_builds namespaces].freeze - MSG = "Adding new index to #{FORBIDDEN_TABLES.join(", ")} is forbidden, see https://gitlab.com/gitlab-org/gitlab/-/issues/332886".freeze + MSG = "Adding new index to #{FORBIDDEN_TABLES.join(", ")} is forbidden. " \ + "For `ci_builds` see https://gitlab.com/gitlab-org/gitlab/-/issues/332886, " \ + "for `namespaces` see https://gitlab.com/groups/gitlab-org/-/epics/11543".freeze def on_new_investigation super @@ -40,6 +42,9 @@ module RuboCop def on_def(node) return unless in_migration?(node) + direction = node.children[0] + return if direction == :down + node.each_descendant(:send) do |send_node| add_offense(send_node.loc.selector) if offense?(send_node) end |