Skip to content

Add RuboCop rule for preventing using histogram method on large tables

What does this MR do?

Related to #325516 (closed)

This adds UsageData/HistogramWithLargeTable cop that checks calls to histogram method in Gitlab::UsageData for models that wrap large tables as defined in migration helpers, because batch counting with histogram is not supported.

HighTrafficTables from Migration/UpdateLargeTable couldn't be used directly - Rubocop doesn't have the Rails context, so mapping the tables to relevant models on the fly using ActiveRecord is not possible. Instead, I manually specified models that have the relevant table_names in the cop configuration.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Piotr Skorupa

Merge request reports