Skip to content

Remove "AND" operator - migrate and schema changes

What does this MR do and why?

We want to remove an unused feature. See #440599 (closed) for context.

This MR addresses item 4)-6) in the plan below and therefor concludes the removal 🎉

I found out that the generator cannot output AggregatedMetric. So step 4) was really only to make operator optional.

The mention of operator is also removed from the docs, which was not mentioned in the plan but brought up here: !144857 (comment 1774490637)

The plan is to remove the feature entirely in a few steps to make reviews easier:

  1. Remove usage of the Intersection class from all sources postgres_hll and redis_hll
  2. Remove the Intersection class and support for using the AND operator
  3. Remove all usage of the operator property in the code
  4. Update generator to output metric definitions without operator. (Requires that operator becomes optional in the json schema)
  5. Migrate remove operator from all (currently 77) aggregated metric definitions
  6. Update json schema do disallow the operator property

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Add operator to the metric definition: config/metrics/counts_28d/20210216174910_analytics_unique_visits_for_any_target_monthly.yml

     aggregate:
       operator: OR # <--- Add this line
       attribute: user_id
  2. Check that the validation fails by running: bundle exec rspec spec/lib/gitlab/usage/metric_definition_validate_all_spec.rb

Related to #440599 (closed)

Edited by Jonas Larsen

Merge request reports