Skip to content

Add list of all current product groups and use it in schema

Jonas Larsen requested to merge j_lar/create_allow_list_for_product_groups into master

What does this MR do and why?

Addresses 1) from &12644.

With this change it is no longer possible to use invalid for strings as product_group values.

This list is extracted from https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/data/stages.yml?ref_type=heads and the procedure for keeping it in sync is described in &12644.

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. Change product_group to postgres in config/metrics/settings/20230328165533_mode.yml
  2. Run bundle exec rspec spec/lib/gitlab/usage/metric_definition_validate_all_spec.rb and see the spec fail
Edited by Jonas Larsen

Merge request reports